---
title: "How to create Confluence pages"
canonical: "https://support.appfire.com/space/SUPPORT/89136580/How%20to%20create%20Confluence%20pages"
format: markdown
---
> Macro (toc)

### Summary

At a stage in the workflow of a JIRA issue, you may want to do some action against the Confluence instance. For instance, create a skeleton design page or add a comment to an existing page. By taking advantage of the normal Confluence notification support, this could be used to involve non-developers in the workflow of an issue including people that may not have direct access to JIRA. This is relatively easy to do. 

It is assumed you are familiar with JIRA workflow design and editing. You should also be comfortable running CLI actions from the command line first.

### Steps

1. Determine the CLI action(s) you want to run on your Confluence instance.
2. Use the Confluence CLI client to test running of the action(s) to ensure you have the right parameters and it does everything you need. In the case of creating a page, make sure the page looks they way you want it.
  - Use [addPage](https://appfire.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-addPage) to create a new page. An alternative is to use [storePage](https://appfire.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-storePage) if you want to create a page or overwrite an existing page.
  - A better alternative may be to use [copyPage](https://appfire.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-copyPage) to copy a template page. Use [descendents](https://appfire.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-descendents) parameter to copy a whole tree of template pages.
  - Recommend using **wiki** markup (default) as it is normally easier to deal with. An alternative is to use storage format ([noConvert](https://appfire.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-noConvert) parameter) but make sure it is accurate by copying from an example page storage view.
3. Recommend the following to help you will problem determinate: [How to add advanced logging](https://appfire.atlassian.net/wiki/display/JCLIP/How+to+add+advanced+logging).
4. Edit your workflow.
5. Select to **Add a post function** in the appropriate transition.
6. Select **CLI action**.
7. Select **Confluence** in the **Product** pulldown.
8. Copy the single CLI action from step 2 into the **Action** field. Note that [Substitution variables](https://appfire.atlassian.net/wiki/spaces/JCLIP/pages/71139762/Substitution+variables) can be used.
9. If you have multiple actions, use the [run](https://appfire.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-run) action in the **Action** field and all the individual actions in the **Data** field, one per line.
10. Save.
11. Publish the workflow.
12. Test on an example issue by running the workflow step.
13. Verify the page is created as expected.

![image](media://a72de272-a71d-4c0c-ab94-1ae2157ace84)

### Advanced Examples

The above shows the setup required to run a Confluence action as part of a JIRA workflow. Once that is mastered, you can easily extend your example to cover more advanced user scenarios. That usually means a more complicated Confluence action needs to be run. It is best and fastest to construct that by using the Confluence client to test first and then once you are happy with the result, it can be copied back into the JIRA post function. Here are some scenarios:

> Macro (table-plus)
> 
> | **Scenario** | **Action** | **Discussion** |
> | --- | --- | --- |
> | Copy a page (used as a template) | [copyPage](https://appfire.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-copyPage) | Likely you will need to use the [findReplace](https://appfire.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-findReplace) parameter to make substitutions based on issue information. See [How to use findReplace](https://appfire.atlassian.net/wiki/spaces/SUPPORT/pages/89147470). |
> | Copy a page hierarchy | [copyPage](https://appfire.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-copyPage) | Use [descendents](https://appfire.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-descendents) or [children](https://appfire.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-children) parameters. |
> | Link a page back to JIRA | [addPage](https://appfire.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-addPage) | Use something like:<br>```
> --content " ... \n {jira:%original_key%} \n ..."
> ``` |
> | Link a page back to JIRA | [copyPage](https://appfire.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-copyPage) | Use something like:<br>```
> --findReplace LINK_TO_ISSUE:%original_key%
> ```<br>With page content like the following. Add as storage format with source editor or equivalent using the UI editor.<br>```
> <p>
>   <ac:macro ac:name="jira">
>     <ac:default-parameter>LINK_TO_ISSUE</ac:default-parameter>
>   </ac:macro>
> </p>
> ``` |