How do I get and set a Confluence page's status from a Jira automation?

Sérgio Baixo September 6, 2024

Basically the goal of what I'm supposed to do is to change a confluence page's status based on a Jira issue type, i.e. if a Jira issue transitions to "In Progress" it's respective Confluence page should change it's status to "In Progress". The Confluence already exists. So I am using the GET to get this value and lastly, the PUT to update it to the new status. But I can't even get this status value since it does not show up in the content. I am sharing the complete automation. Any help is appreciated.

automation.png

 

1 answer

1 accepted

0 votes
Answer accepted
Michel Neeser
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 8, 2024

Hi @Sérgio Baixo and welcome to the community!

You can get the status of a page by using this endpoint of the Confluence API as follows:

SCR-20240908-megv.png

Please note that the number in the URL is the page ID.

To update the page status, you can use this endpoint as follows:

SCR-20240908-mekd.png

For a list of all available statuses and their IDs, have a look at this endpoint.

Hope this helps!

Sérgio Baixo September 9, 2024

Hi there @Michel Neeser thank you for your welcome and for your response. The GET request worked and I was able to get the web response body that I needed. As for the POST request, your answer was not working for me due to the request body. After much trial and error, I found the the correct answer, for my case, was to leave the request body just like this:

{
"id": "48169017",
"name": "In Progress",
"color": "#2684ff"
}

I had to perform a GET for each state to get it's respective color and ID to proceed with the rest of my automation.
Nonetheless you helped me a lot, thanks again :)



successfulRule.png


Michel Neeser
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 9, 2024

@Sérgio Baixo A PUT request with the body containing only the ID worked for me, although this might be because I was using Confluence’s default statuses. Either way, glad it helped! :-)

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events