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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,137
Community Members
 
Community Events
185
Community Groups

How to update issue rank when status changes with Jira Automation?

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?

1 answer

1 accepted

0 votes
Answer accepted
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 28, 2022

Hi @Alejandro Blanco 

this seems similar to a question I answered in the past. Please see my answer in the link below:

https://community.atlassian.com/t5/Jira-Service-Management/Move-cloned-issues-to-top-of-the-backlog/qaq-p/2116786

 

Best
Stefan

Like Stefan Salzl likes this

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:

  • When: Issue transitioned to <status>
  • Send web request
    • Figure out latest issue in the column
  • Send web request
    • Update rank value for the issue being moved

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.

Docs: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-search-get

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).

Docs: https://developer.atlassian.com/cloud/jira/software/rest/api-group-issue/#api-rest-agile-1-0-issue-rank-put

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.

Like # people like this
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 29, 2022

Hi @Alejandro Blanco 

Wow.....Awesome effort! Thanks for sharing your solution in such a detailed way so that other community users can benefit from it.

Best
Stefan

Like # people like this
Óscar Giménez
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!
Feb 22, 2023 • edited

Hi @Alejandro Blanco !

Thanks for sharing your solution, that's great!.

Edited: I was pointing to ".com" instead ".net".

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.

Like Óscar Giménez likes this

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. 

Suggest an answer

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

Atlassian Community Events