Order by the same ticket order as shown in the "IN" clause

Mohamad Ibrahim December 11, 2021

Hello,

 

I have a JQL that has an "IN" clause which contains a list of jira tickets IDs. I want to show this list of returned jira tickets in the same order as listed in the "IN" clause. Here's the JQL script:

id in (PENNY-2852, PENNY-2853, PENNY-2854, PENNY-2855, PENNY-2856, PENNY-2857, PENNY-2858, PENNY-2860, PENNY-2861, PENNY-2862, PENNY-2863, PENNY-2864, PENNY-2865, PENNY-2866, PENNY-2867, PENNY-2868, PENNY-2872, PENNY-2873,PENNY-2898,PENNY-2896,PENNY-2897,PENNY-2913,PENNY-2912,PENNY-2935,PENNY-2911,PENNY-2934,PENNY-2915,PENNY-2933,PENNY-2914) "

 

ORDER by key does not help much as the tickets could be created in any random order but the order mentioned in the "IN" clause should be maintained. How can I achieve that?

2 answers

0 votes
dkamath
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 3, 2023

id in (PENNY-2852, PENNY-2853, PENNY-2854, PENNY-2855, PENNY-2856, PENNY-2857, PENNY-2858, PENNY-2860, PENNY-2861, PENNY-2862, PENNY-2863, PENNY-2864, PENNY-2865, PENNY-2866, PENNY-2867, PENNY-2868, PENNY-2872, PENNY-2873,PENNY-2898,PENNY-2896,PENNY-2897,PENNY-2913,PENNY-2912,PENNY-2935,PENNY-2911,PENNY-2934,PENNY-2915,PENNY-2933,PENNY-2914) ORDER BY id

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 11, 2021

There's no way to do that.  Your "in" clause has nothing to do with ordering.

You'll need to look at other data on the issues for your sort.

Mohamad Ibrahim December 11, 2021

Why tickets are not ordered by the same order sent in the "in" clause should not be the case? Any suggested workarounds?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 11, 2021

Why would they be? 

A question asking for a list of issues is one thing.  How you display it (including the sort order if one even applies in your result report) is another thing.

You'll need to look at something else to do the ordering.

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events