I'd like to be sure that a JQL query like this preserves the order in its output:
key in (WEB-110,WEB-111,CARCH-20,WEB-112,JPDF-5,WEB-113)
So the expected output would be the issues in this order:
WEB-110,WEB-111,CARCH-20,WEB-112,JPDF-5,WEB-113
Instead, we receive them in this order:
WEB-113,WEB-112,WEB-111,WEB-110,JPDF-5,CARCH-20
(So it looks that JIRA returns them in some default "project desc, key desc" order?!)
Is this possible to tell JIRA not to resort the result?
Community moderators have prevented the ability to post new answers.
The only way I know to change the order of the retrieved results would be through the ORDER BY keyword.
If the order you wish to get doesn't match any other more appropriate field (ie: created, updated, resolved...), then you can follow this quick approach:
Execute the JQL:
key IN (WEB-110,WEB-111,CARCH-20,WEB-112,JPDF-5,WEB-113) ORDER BY labels
Note that this workaround will fail if those issues have any other labels besides the one containing its order number.
There's a more elegant approach, involving the creation of a numeric custom field.
Thank, Volodymyr. Unfortunately, in this scenario I don't have the rights the control to add custom fields, so I can't use this workaround.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I copied over the answer from the other answer. I meant "Thanks, Ignacio", of course.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried the labels approach?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, I cannot modify the issues at all, so this wasn't a solution. (It seems that we may even re-sort the result set in our own code...)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you interact with JIRA programmatically, then you should sort the result set within your code, which is even a better approach than both of my 'workarounds' using just JIRA.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yep, that's we have concluded, too. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why do not you sort them by adding "order by". If order based on standard fields does not suit you can add custom number field "Order" and set values for it 1,2,3,4...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank, Volodymyr. Unfortunately, in this scenario I don't have the rights the control to add custom fields, so I can't use this workaround.
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.