Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  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 to create a new page. An alternative is to use storePage if you want to create a page or overwrite an existing page. 
    • A better alternative may be to use copyPage to copy a template page. Use 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 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.
  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 can be used.
  9. If you have multiple actions, use the 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.

...

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:

Table plus
autoNumbertrue


ScenarioActionDiscussion
Copy a page (used as a template)copyPageLikely you will need to use the findReplace parameter to make substitutions based on issue information. See How to use findReplace.
Copy a page hierarchycopyPageUse descendents or children parameters.
Link a page back to JIRAaddPage

Use something like:

No Format
--content " ... \n {jira:%original_key%} \n ..."


Link a page back to JIRAcopyPage

Use something like:

No Format
--findReplace LINK_TO_ISSUE:%original_key%

With page content like the following. Add as storage format with source editor or equivalent using the UI editor.

No Format
<p>
  <ac:macro ac:name="jira">
    <ac:default-parameter>LINK_TO_ISSUE</ac:default-parameter>
  </ac:macro>
</p>