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,552,465
Community Members
 
Community Events
184
Community Groups

Set Rank with Scriptrunner

Good day,

I have following user case:

I have Structure with 2 levels Assignee->Issue sorted by Rank. So users make their tasks from first, than second ...

I want to add following functionality. If some user create new urgent issue and set in create issue window special check box ("urgent task"), then new issue will be placed before actual first issue in Structure for the same assignee. So I need to set Rank of new issue lower than that first issue.

So Scriptrunner script looks to have following logic:

- read Structure

- find first issue for user whom assigned new issue and read its Rank

-set Rank to new issue lower

 

But I can't find functions in Java API or examples in Adaptavist library , how to read and set Rank. Please help.

If you know how to make the same other way, it will be also fine.

 

Regards,

Alexander 

2 answers

1 accepted

0 votes
Answer accepted
Nir Haimov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 06, 2021

Hi @Alexander Raymukanov 

You didn't find any documentation to set Rank because there is no way to do so.

Rank is a system field that it's actual value is encrypted and not human read.

I know in the tickets in the UI you see numbers for Rank, like : 1, 2, 5, 9...

But behind the scenes, each number will be some complex value like "alskdjaslkfjlsdjkfsd" so you can't create the actual Rank value the system expect to.

Many apps like Structure make such Rank setting with drag and drop in list sorted by Rank. And that’s why I assume that such Java functions like issue.setRankLower(referenceIssue) should exist. 
But maybe they use REST API where this commands exist and documented. 

Nir Haimov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Apr 06, 2021

Maybe you are right,

Last time i was in a discussion like that, i remember that the conclusion was as i told you (from the JAVA API side), maybe as you said, from the public API there is a way to do it, i didn't check so i can't tell

Check out Solved: Change issue Rank using scriptrunner (atlassian.com). The Java Class you're searching for seems to be com.atlassian.greenhopper.api.rank.RankService.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events