On this page
Use case
Create a Confluece page with macros to display issues from a Jira instance after transitioning an issue. The issues for the macros can be obtained from the transitioned issue or from a JQL query.
Prerequisites
Configuration
Action*
Select the Create a page remote action template for Confluence on premise.
Connection*
Choose a connection to the Confluence instance if it exists. If not, create a new one based on the example for a Confluence on premise instance.
Customize your action
Update the Action body field with the following expression:
{ "title": "Confluence page for %{issue.key}", "type": "page", "space": { "key": "DS" }, "body" : {"storage": {"value":" <p>Link to the Issue: <ac:structured-macro ac:name='jira' ac:schema-version='1' ac:macro-id='cd527206-2486-4b42-8ffd-14d4489fd717'><ac:parameter ac:name='server'>Your Company Jira</ac:parameter><ac:parameter ac:name='columnIds'>issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution</ac:parameter><ac:parameter ac:name='columns'>key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution</ac:parameter><ac:parameter ac:name='serverId'>9f2d636e-c842-3388-8a66-17c1b951dd45</ac:parameter><ac:parameter ac:name='key'>%{issue.key}</ac:parameter></ac:structured-macro></p> <p><br /></p> <p><strong>More issues in the project: </strong></p> <p><ac:structured-macro ac:name='jira' ac:schema-version='1' ac:macro-id='b21fb7a7-f663-426a-b3d9-759f2be81ae8'><ac:parameter ac:name='server'>Your Company Jira</ac:parameter><ac:parameter ac:name='columnIds'>issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution</ac:parameter><ac:parameter ac:name='columns'>key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution</ac:parameter><ac:parameter ac:name='maximumIssues'>20</ac:parameter><ac:parameter ac:name='jqlQuery'>project = %{issue.project.key} </ac:parameter><ac:parameter ac:name='serverId'>9f2d636e-c842-3388-8a66-17c1b951dd45</ac:parameter></ac:structured-macro></p> ", "representation":"storage"} } }
Make sure that you replace the Confluence space key in the Action body to the appropriate one before testing the post function. Using an incorrect or nonexistent space key would prevent the creation of the page.
This Action body is used to create a page with two different macros in a space with DS key. The first macro displays a link to the Jira issue that created the page and the second one to the issues in the same Jira project as the transitioned issue.
The second macro can be modified to run under a different JQL query by changing the query project = %{issue.project.key}
in the expression with the desired one.
Related use cases
If you still have questions, feel free to refer to our support team.