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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How is the JIRA Agile Lexorank field formatted?

We are building a JIRA Agile external integration where we need to use the rank of an issue on an Agile board to drive some business logic. The new Agile 6.6 rank custom field is fieldtype 'lexorank', and formatted strangely (e.g. 1|hyi4w0: )

I've read that that the '1|' prefix encodes the lexorank "bucket" and is used in "rebalancing" operations.

What about the rest of the encoding?

How can I convert the encoding to an integer that I can use in my business logic?

3 answers

1 accepted

2 votes
Answer accepted

Hi, you would not need to decode the lexo rank field to determine the rank of the issue in the board. The value of the lexo rank is calculated by ordering the issues on the board lexicographically(dictionary order). As @Tom Jackson has pointed out. There are 3 buckets used in the process of lexicographically sorting the issues in the JIRA, hence the 1|, 2| and 3|. The rest of the characters and symbols are the product of the sort itself.

So if you need to order the issues they way it looks on the board in JIRA, you have to apply order by caluse to the lexo rank field/ sort this in your code. Ideally both in the database order by clause and the array.sort functions of any coding language orders your string alphabetically.

did you get any answer to your question? I would like to know how to encode this rank value to order a list of issues manually.

Pretty sure the encoding is just a string that can be alpha-sorted (after removing bucket prefix). Have a colleague that figured this out. Hopefully she will chime in with additional details...

Yes you are right - it can be simply ordered as string value! it seems to work..

It will work as a string but if you're desperate (for some reason) to get an integer out of it, it is just a base-36 value.

If you remove the bucket and pipe and closing colon and parse as base -36 you'd get your answer

in JS
```
var lexoRank = '1|hyi4w0:';
parseInt(lexoRank.replace(/^\d+\|([a-z0-9]):/, '$1'), 36) // => 1085878080
```

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira

⏰ Day in the life of a Jira Admin!

Hello Community! We thoroughly enjoyed this just-for-fun conversation in the Jira Admin Group about what it's like to be a Jira Admin. For #JiraJuly, our talented designers created these graphics t...

507 views 2 17
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you