Versions Compared

Key

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


Excerpt
hiddentrue

 Post function to automatically create Confluence page within JIRA workflow

...


Page title and content are defined in this section.
Page Title: As you know, Confluence does not permit the same page title within the same space. So, adding a unique key to the page (like JIRA issue key) would be wise
Request body: Leave blank if you are not an experienced user, and you want to follow the standards. Click on the Load default body to modify the link if you want to see and change the request JSON body. Otherwise, leave blank.
Parameters: Add static or dynamic parameters here. Some sample parameters are shown below. These parameters can be used within double curly-braces in a Confluence page

Image Modified

Some code example below;

Panel

assignee = $issue.assignee or {{issue.assignee}}
reporter = {{issue.reporter}}
date = $issue.created
formattedDate = $DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm").format($issue.created)
productName = $issue.getCustomFieldValue($customFieldManager.getCustomFieldObject('customfield_11100'))
price = $issue.getCustomFieldValue($customFieldManager.getCustomFieldObject('customfield_11102'))
displayName = $user.displayName
userDisplayName = $ComponentAccessor.getUserManager().getUserByName("someUser").getDisplayName() // you can also use ComponentAccessor
story point = $issue.getCustomFieldValue($customFieldManager.getCustomFieldObject('customfield_1110011101'))
environment = Production
comment = $comment // this is the comment that is passed through the transition

...

Info

If you want to leave empty if no value specified, add ! after $ sign. e.g.:

story point = $!issue.getCustomFieldValue($customFieldManager.getCustomFieldObject('customfield_11100'))


Click the Add button, and that's it. Please do not forget to publish the workflow.

...