Automating the creation of a Confluence page linked to a Jira ticket

30 comments

Esther Strom
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 13, 2022

@Ruud Ravensbergen I haven't actually tried that because it's not something we had a need for. I'll see if I can figure it out.

Esther Strom
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 2, 2022

@Ruud Ravensbergen apologies for the delay; I just got around to this today.

I haven't figured out how to pull the description in yet, and think that one may be more difficult because of the possibility of formatting text. The manipulating content examples on developer.atlassian.com may be helpful.

But as to how to put the page in a specific place (i.e. as a child of a specific parent), if you know the parent ID you can do it.

This is assuming a static parent page; if you need to set different parents based on criteria you might be able to do it by setting a variable that then gets included in your json.

This is my json for creating a new page with a link to the Jira ticket, nested under a specific parent page:

 

{
"type":"page",
"title":"{{issue.key}} {{issue.summary}}",
"space":{"key":"CAA"},
"ancestors":[{"id":4815388701}],
"body":{
"storage":{
"value":"<ac:structured-macro ac:name=\"jira\" ac:schema-version=\"1\" ac:macro-id=\"e03caffe-8222-42ec-8f49-a53fcfbdf80e\">\n <ac:parameter ac:name=\"server\">System JIRA</ac:parameter>\n <ac:parameter ac:name=\"columns\"> key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution</ac:parameter>\n <ac:parameter ac:name=\"serverId\">c5a16fc3-0742-303f-b02a-822c531694b6</ac:parameter>\n <ac:parameter ac:name=\"key\">{{issue.key}}</ac:parameter>\n </ac:structured-macro>",
"representation": "storage"}
}
}

The key here is the ancestors object. You can find the page ID in the URL of your parent page in Confluence. 

Like Ruud Ravensbergen likes this
Ruud Ravensbergen June 3, 2022

Thanks great

Muhammad Ahmad
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 19, 2022

@Esther Strom I am not able to view "View Storage Format". Can you please help?

Judith Shiferaw
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 24, 2023

Thank you very much for the instructions, it works very well. My question would be, how can I configure the automation to use a template when creating a new Confluence page (linked to a jira ticket)?

TAGS
AUG Leaders

Atlassian Community Events