Advanced search - prioritizing Epics in custom Order by

Thomas Craig April 17, 2024

I am writing an advanced search to find all issues within a set of epics, and then sort it based on priority:

    "Epic Link" in (INS-1234, INS-1235, INS-1236) ORDER BY priority DESC

I would like to modify the ORDER BY so that for each priority level, it returns issues based on a fixed priority of epics.  For instance, when returning all high priority issues, display those from epic INS-1236 before INS-1235 and INS-1235 before INS-1234. I am not looking to simply order the epics' issues based on their raw alphanumeric values.

Is this something that can be achieved in JQL?

In T-SQL, I might do something like this:

SELECT *
WHERE [Epic Link] IN ('INS-1234','INS-1235','INS-1236'
ORDER BY priority DESC
,CASE [Epic Link]
WHEN 'INS-1234'
THEN 1
WHEN 'INS-1235'
THEN 2
WHEN 'INS-1236'
THEN 3
END

 

2 answers

1 vote
Josh Costella
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 17, 2024

Hi @Thomas Craig 

Have you tried adding an additional criteria to the ORDER BY?

Something like:

ORDER BY priority DESC, parent ASC

FYI, you'll want to move to using the Parent field has Atlassian is moving away from Epic Link.

Thomas Craig April 17, 2024

I am looking for a fixed ordering on parent, where I can define A comes before B -- not just ordering by the raw alphanumeric values of the parent names.

Josh Costella
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 25, 2024

Unfortunately, that will be difficult to do out-of-the-box. I would recommend a third-party plugin like JXL. It allows for more customized orders of tickets. 

0 votes
Stephen_Lugton
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 17, 2024

@Thomas Craig you can order by more than one thing, so change it to

Order by parent Desc, priority desc

or maybe order by priority Desc, Parent Desc, I can;t remember which you need first

 

Thomas Craig April 17, 2024

Please take a look at my other comment.  I am not trying to sort on the raw text value of the Parent.  I have updated my question to make this clearer.

Stephen_Lugton
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 18, 2024

You could add a new custom field 'Epic Priority' with a numeric value, then order by that field, or use a label for the same purpose

Stephen_Lugton
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 18, 2024

Actually thinking about it that wouldn't really achieve what you want as you'd have to put it on every child task, unless you had automation that updated child tasks when the 'Epic Priority' on the Epic was changed.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events