How to get the rank with Jira API

JORDAN JONES May 4, 2017

I am looking to get the rank(The order of items in the backlog for example) from my jira board, and read it from the API. We used to be able to do this with a customfield but now we can not. Is there any way to get this custom field back? Or is there another way to do it?

2 answers

1 vote
bschmuhl September 11, 2020

I found that value in customfield_10019 and appears to be sortable alphanumerically. You won't be able to derive a human-readable number unless you can compare it to the context of what you're speaking to. If you have that set of issues, you should be able to rank them, and then number them. If I understand correctly, the rank is global—meaning it still applies after an issue has been resolved, and whether or not its in a sprint. This makes a single rank number pretty meaningless as discussed here: https://community.atlassian.com/t5/Jira-questions/How-to-see-numeric-rank-order-for-an-issue/qaq-p/611802

0 votes
MattS
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 4, 2017

Rank is a string now, not an obvious number. Will that be useful?

 

JORDAN JONES May 5, 2017

I found the string, but it is really weird. I get strings like x|xxxxx: how do I decode these strings to usable numbers?

Mikhail Kurskiy April 19, 2018

@JORDAN JONES, how did you done it?
Which method? - I could not find it in API documentation :(

Like # people like this
Jared Kells
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 1, 2023

The string is sortable, so while it isn't a number if you lexicographically sort based on the string you will get the correct order.

The problem with using numbers for a global rank is that when one issue is changed every other issue ranked below it would need its rank updated. You can imagine how expensive this would be when you have hundreds of thousands of issues.

 

Jira uses the LexoRank algorithm, you can learn a bit about it here: https://confluence.atlassian.com/adminjiraserver/managing-lexorank-938847803.html

It's a cool algorithm because given any two strings you can always find a new string that's ranked between them so long as you're happy for the string length to increase.

For example given the strings "a" and "b" you can add "aa "ab" "ac" and they will all slot in between "a" and "b"!

Jira then periodically re-balances the field as a background job when the strings get too long.

Like Kalyan Sattaluri likes this

Suggest an answer

Log in or Sign up to answer