Forums

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

Problems with Sorting multiple Fields in my JQL Query

Steffen Jantke
Contributor
April 14, 2020

Hi everyone,

Here comes my first question as I'm handling with some problems within my JQL query:

project = XXX AND issuetype in (Bug, Test) AND status in (Open, "In Progress") AND created <= -8w AND updated <= -4w ORDER BY created ASC, priority DESC

This query should show me all bugs and tests (I've shorten the query) ordered by created asc and priority desc. This only sorts my list with the created field, but the priority attribute is ignored. This "effect" also comes up when I use another parameter, e.g. assignee asc; no sorting here as well.

... ORDER BY created ASC, assignee asc

makes the list look like:

11.04.2020 employee A
12.04.2020 employee R
13.04.2020 employee J
14.04.2020 employee I

The confusing thing is that they seem to be automatically sorted by issue type?!

I hope, you can support here.
Thanks a lot!

Kind regards,
Steffen

1 answer

1 accepted

2 votes
Answer accepted
Andrew Laden
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.
April 14, 2020

Not sure what you are expecting to see here.

When sorting by two fields, the only time the 2nd field is used is if the first field is identical for two issues. Since you are using "created" as the first field, which is believe is a date/time field, unless 2 issues were created in the exact same second, you will never see any sorting on the 2nd field.

Steffen Jantke
Contributor
April 14, 2020

Hi, Andrew. Thank you so much for your explanation. It seems I didn't formulate my use case correctly. Your explanation made that clear. Thank you for that. Correct answer!

Suggest an answer

Log in or Sign up to answer