Recently, I encountered a requirement to automate Jira work item(s) based on the page status value of a linked Confluence page.
While Confluence automation offers an action to address Jira work item, the action in automation relies on JQL and there for acts on more issues then the linked Jira work item on the Confluence page
Also the Jira work item(s) are not placed on the page via a Smart link or Jira issues macro.
Automation for Confluence and Jira Rest API
This automation rule is based upon setting Confluence Page to page status "Rough Draft" and to transition the related PIR issue to status "Draft"
The rule can be adapted to your required requirements.
The below steps will help you to update the work item "status" related to the corresponding "page status".
Add a Send web request action to get the Jira work item(s) where the Confluence link is set using and old server Rest API
In the Authorization header make sure that you add the keyword Basic followed by the base64 of your emailaddress:APItoken. So if the base64 of the emailaddress:APItoken is AB12XY45 then to the Authorization header add the value Basic AB12XY45
Add the following Web request URL:
https://<Cloud site URL>/rest/api/jira-metadata/1.0/metadata?pageId={{pageid}}
Add the Content-Type and "Application/JSON" header
Check the option "Delay execution of subsequent rule actions until we've received a response for this web request" as the response contains the Jira work items linked to the Confluence page
{{webResponse.body.groups.items.name.flatten()}}
Marc - Devoteam
Principal Atlassian Consultant
Devoteam
Amsterdam, The Netherlands
1,003 accepted answers
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
2 comments