Details
-
Suggestion
-
Resolution: Won't Fix
Description
Issue Summary
Many times when using JQL users want to sort issues in a specific way. While the Order By operators will allow users to sort all the results in either ascending or descending order, it forces all issues with null values on the order field to be placed at the end or beginning depending on the direction. It would be very helpful to instead have some kind of hierarchical sorting method to order the first set of issues, and then a second order by to then arrange the other sets of issues that might have null values for the first search.
There is a great example of this problem that might help explain it better. Let's say you want a single JQL query to return all Epics, and all issues in those Epics, and you want JQL to order these in a manner such as:
Epic 1 - Task 1 - Task 2 Epic 2 - Task 3 Epic 3 - Task 4
There lies a problem in trying to do this. You can return all these issues in one query such as
type=epic or "Epic Link" is not empty Order by "Epic Link"
This returns those issues, but since Epics themselves don't actually have an epic link value for that field, they are always getting sorted to the bottom. You could alternatively try to order by "Epic Name", but since the other issues in the query don't actually have an Epic Name value for themselves, you can't order them by that either.
Suggested Solution
It would be helpful if there was either a group by function like sql has, or perhaps some other means to first order the first set of issues (epics), and then order by the second set while ignoring null values in the first order statement.
Why this is a problem
Would be a helpful means to organize information.