Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to group issues with JQL where I can indicate the order(other than DESC or ASC)?

Carlos Garcia Navarro
Community Champion
January 26, 2018

Hi, I want to create a filter in JIRA that orders the issues by status and by date of creation.  My JQL looks something like this: "issuetype = D-patch order by status, created".  What I really want is to group the different issues by status and then order them by date of creation.  My query will do that, but will use alphabetical order for the status.  Is there a way to indicate the order I want for the status? e.g. to show the results group by status following this order "In Queue", "In Progress", "Need more information", "Done", "Resolved", and for each group the issues are ordered by creation date.

Thanks!

Carlos

3 answers

1 accepted

1 vote
Answer accepted
Ignacio Pulgar
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 29, 2018

Hi Carlos,

Good news! You'll be able to achieve what you want.

Fortunately, the Order By clause doesn't order the Status field alphabetically.

You can decide the order of statuses from:

<your Jira URL>/secure/admin/ViewStatuses.jspa

Just click on the up/down arrows to order the statuses as per your needs:

status-order.png

After that, "ORDER BY status ASC" will retrieve the same status order you had defined on that page.

Besides, this status order is also used in gadgets.

Hope it helps.

Carlos Garcia Navarro
Community Champion
February 6, 2018

Thanks, Ignacio.  I think this will help me accomplish what I I needed.

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 26, 2018

JQL is not the same as SQL.  It does not return data or say anything about how to present it.  It simply gives back a list of issues that match.

It is up to the presentation code running the search to decide how to display it.  The issue navigator does not support grouping.  Some reports do, but they do it in themselves, they don't look at the search.

The "order by" clause is the only exception - it is used by *some* code that runs searches for ordering when it matters (boards and the issue navigator are the two that spring to mind when someone asks what might use it, and I think a couple of gadgets and reports use to too)

Carlos Garcia Navarro
Community Champion
January 26, 2018

Thanks, Nic!

Carlos Garcia Navarro
Community Champion
January 26, 2018

Thanks, Mathieu!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events