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

REST API for Ranking

landon.clark March 31, 2012

I really want to do a batch reorder of Ranks for my Green Hopper issues. I have a JQL query that has an order by part that looks like this:

order by fixVersion, Priority, "Global Rank"

That will return a list of issues and then I want to set the Global Rank based on that. So basically in pseudo code:

for (indx, issue in issues):
issue.set_rank(indx)

Reading this page:
http://confluence.atlassian.com/display/GH/Ranking+Issues+in+GreenHopper

It says (in the last comment) - There is a REST API for ranking. I have been looking for that API for a while but I can't find it.

Please help?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

5 votes
Answer accepted
sclowes
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.
April 1, 2012

Hi Landon,

The REST API can be browsed using the REST endpoint browser. The particular endpoint you are looking for is a PUT request to /rest/greenhopper/1.0/rank. The request body looks like:

{"issueKeys":["ANERDS-102"],"rankBeforeKey":"ANERDS-94","rankAfterKey":"ANERDS-7","customFieldId":11431}

The issueKeys are the items to rank (there can be several), the rankBeforeKey is the issue to rank the items before and the rankAfterKey is the issue to rank these items after. Because there may be multuple Global Rank fields in your JIRA the customFieldId is used to specify which one is used for this ranking.

Regards,
Shaun

Sorin Sbarnea (Citrix)
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.
October 7, 2013

Thanks for the insight as the REST API browser does not provide any information regarding which parameters it would expect.

Now the problem is that this solves the ranking only between issues but how about ranking and sprints?

tomcwalker October 23, 2018

Hi Shaun,

This is helpful, but I could use a little more information:

- How do I determine how to set "customFieldId" correctly in this context?

- What's the equivalent method to get rank rather than set it?

Thanks,

Tom Walker

TAGS
AUG Leaders

Atlassian Community Events