Update page state through Jira automation web request

Raphael Teodoro
Contributor
December 12, 2023
Hello everyone,
I'm trying to set a page state according to a Jira issue transition. The rule is simple as: when I transition the issue to status "Ready for review" send web request to Confluence and set status in page as "Ready for review".

I'm following this REST API call - https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-content-states/#api-wiki-rest-api-content-id-state-put

I did the gets to make sure I'm using the correct state ID, name and color. However I keep getting the message:
Error publishing web request. Response HTTP status:
400
Error response HTTP body:
{"statusCode":400,"data":{"authorized":true,"valid":true,"errors":[],"successful":true},"message":"com.atlassian.confluence.api.service.exceptions.BadRequestException: Invalid status 'null'. The status must be one of [current,draft]."}

Also read the information for error 400:
Invalid Name/Color, non-existent id of content state, or type of state desired is not allowed. Name must be less than or exactly 20 characters. Color must be a valid hex string. Status must be in [draft,current].
I even tried doing this before publishing the page (as a draft), but I still get this error message.

What am I missing here?

1 answer

1 accepted

2 votes
Answer accepted
Raphael Teodoro
Contributor
December 12, 2023

For those wondering what is wrong, Atlassian's documentation for setting content state of a Confluence page is missing /state?status=current in the web request URL. As displayed in RED in the screenshot below:

setpagecontentstateconfluenceapi.png

Hope Man
Contributor
November 28, 2024

Thanks a ton!

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events