Hi. I'm trying to update the rank of issues when they get moved to a new status (column in board). I want to create an automation rule that will rank all new issues in that column to its very bottom.
So far I have been unsuccessful. I've tried to edit the rank custom field with the advance JSON update syntax:
{
"fields": {
"customfield_10019": {
"rankAfterIssueIdOrKey": null,
"rankBeforeIssueIdOrKey": null
}
}
}
And I've also tried using a pivot issue (always at the bottom of the column), putting its ID in the rankAfterIssueIdOrKey property, but that doesn't work either.
How can you edit the issues' rank with Jira automation?
this seems similar to a question I answered in the past. Please see my answer in the link below:
Best
Stefan
Thank you! I've found a potential solution through that link, in this question: https://community.atlassian.com/t5/Marketplace-Apps-Integrations/With-the-Automation-plugin-is-there-a-way-to-set-the-rank-of-an/qaq-p/1087874?utm_source=dm&utm_medium=unpaid-social&utm_campaign=P:online*O:community*I:social_share*
I'll try that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've managed to pull it off. I'll leave a description of the solution here, in case someone else comes looking for the same behaviour.
I've created an automation rule like this:
For the first request I've used the /rest/api/3/search endpoint. That accepts a JQL query, I've used this:
project = <proj_name> AND status = <status_name> ORDER BY Rank DESC
That return the list of issues in the column (status) that we want, with the one at the bottom being first in the list.
For the second request I've used the /rest/agile/1.0/issue/rank endpoint. That accepts a JSON file where you send something like this:
{
"rankAfterIssue": "{{webResponse.body.issues.first.key}}",
"rankCustomFieldId": 10019,
"issues": [
"{{issue.key}}"
]
}
Use {{webResponse.body.issues.first.key}} to access the result of the previous request, the last ticket in the column.
You will have to figure out what the rank custom field id is in your project. You can do that by inspecting the Jira website, looking at the column in a JQL search (add the rank column to the results).
For both requests I've used basic auth: https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/
I don't think it would be possible to use oauth for requests made from Jira automation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Wow.....Awesome effort! Thanks for sharing your solution in such a detailed way so that other community users can benefit from it.
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Alejandro Blanco !
Thanks for sharing your solution, that's great!.
Edited: I was pointing to ".com" instead ".net".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Óscar. Is that you domain? myjira.atlassian.com?
That sounds weird. Are you sure you're sending the request to right endpoint?
Other than that, it looks good, that's basically the same configuration I have working on my project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is incredible. Thank you @Alejandro Blanco for this incredible automation approach for changing Jira rank. Cannot believe it's 2023 and it's an out of the box feature in Jira. Thanks again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, @Alejandro Blanco
I was able to follow your instructions and set up an automation to change stack rank for issues with a certain condition. This was good learning for me. Thanks again!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.