Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automatically increase confluence page version number

Aleksandar Todorovic
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!
December 18, 2022

So i'm trying to automate the release notes and create a confluence page once new release is created. page is created however i'm having issues updating the page since it requires an increase in version number for every ticket in release and only the first ticket will be updated.

 

The request looks like this:

image.png

 

Payload:

{
"id": "{{createdPage.Id}}",
"type": "page",
"title": "{{version.name}}",
"version": {
"number": 2
},
"space": {
"key": "CLINT"
},
"body": {
"storage": {
"value": "{{issue.key}} {{issue.type}} {{issue.summary}}",
"representation": "storage"
}
}
}

The first ticket that is found will be updated but the request will be rejected for every following ticket since version number needs to be increased by 1.

 

"message":"com.atlassian.confluence.api.service.exceptions.ConflictException: Version must be incremented on update. Current version is: 2"} 

I have tried by searching with JQL latestReleasedVersion(), but it's bascially the same, every time it will try to  update the page multiple times for each ticket and fail.

I've tried sending a get request to get the version number for the created page and reference the version with  {{webResponse.body}} smart value and increase this by 1, but this also failed as it seems it can't get the version with  {{webResponse.body.version}} or other variants. The response part that contains the version looks like:

 

_links":{"self":"https://URL-goes-here/wiki/rest/api/content/3368648790/version/1"}}]

However i'm using older jira version without JSON parser and just can't seem to figure out how to update the version automatically or get all the tickets and update the page at once.

1 answer

1 vote
Steven Zhang
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 21, 2022

Hi Aleksandar, have you tried the "Create variable" action? You could define a variable like "count" starting from 1 on the top, and then use the "Create variable" action again on the branch to + 1, such as {{#=}}{{count}}+1{{/}}. And then use the "count" variable in your request action.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events