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