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?
Community moderators have prevented the ability to post new answers.
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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.