JIRA Automation: Create and Publish a Copy of a Confluence Page

Xavi
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!
February 15, 2025

Today, we have the option to create a Confluence page when an issue is created, but it has to be based on a template. There is no option to copy an existing page.

Is there a way to automate this process, either using JIRA Automation, or another approach?

1 answer

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 16, 2025

Hi @Bruno Ribeiro _Brunoxweb_ -- Welcome to the Atlassian Community!

From where in Jira do you see an option to create a Confluence page when you create a Jira issue?  Is that from a marketplace addon / app?

 

Regarding automation rules, I seem to recall there is a REST API endpoint to copy a Confluence page based on its ID value, and if there is...that could be called with the Send Web Request action.

If I am incorrect and that endpoint does not exist, one could instead use a REST API endpoint to read a page's content and then use another to create a new page using the first one's contents (making modifications as needed).

 

Kind regards,
Bill

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 18, 2025

Hey @Bill Sheboy yeah, they introduced this I guess back in March 2024:

https://community.atlassian.com/t5/Confluence-questions/Jira-Automation-to-Create-a-Whiteboard/qaq-p/2649674

But as @Bruno Ribeiro _Brunoxweb_ points out you can only create pages based on a template, and even more annoying, the only thing you can customize about the page is the Title.

Wow didn't know about the Copy page endpoint. And... it works! Neat.

What tripped me up is that I had to NOT include the body that was included in the example, as that's optional.

So the curl example worked, without that:

curl --request POST \
--url 'https://your-domain.atlassian.net/wiki/rest/api/content/{id}/copy' \
--user 'email@example.com:<api_token>' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"copyAttachments": true,
"copyPermissions": true,
"copyProperties": true,
"copyLabels": true,
"copyCustomContents": true,
"destination": {
"type": "space",
"value": "<string>"
},
"pageTitle": "<string>"
}'

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events