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:
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.