Forums

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

Problem with sorting multiple fields in JQL query

Sheri Maxim September 27, 2021

Hello - I have found other questions in the community but the answers don't address my issue. I'm attempting to sort by Parent and then by Status  by using this at the end of  my query: ORDER BY parent ASC, status DESC. The result is ordered by Parent and then Issue Number/Key (example below)

Parent    Status

A             To Do

A              In Progress

A              In Progress

A              To Do

 

Any ideas as to why?

1 answer

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 29, 2021

Hi Sheri,

Sorry to hear about this problem.  I think I have been able to recreate this behavior.  I noticed though that where these issues appear to be getting segmented here in my example is along the lines of team managed projects.  I came across this bug ticket over in https://jira.atlassian.com/browse/JRACLOUD-76274

In which another user reports this same behavior, but for the priority field.  I suspect that this could be happening because of the way in which team managed projects don't always have all their fields being stored in a global context, like most company managed projects would tend to have by default. In a team managed project the status might be the same value in name to a different issue in a different team managed project, but technically these are different values on the backend.

Sorry there does not appear to be a solution here, but I would recommend watching that bug for updates here.

Andy

Bill Sheboy
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.
September 29, 2021

Hi @Andy Heinzer 

Thanks for that candid and revealing information!  And, that would seem to suggest that the use of team-managed projects in an instance could cause other non-deterministic behaviors with advanced searches. 

From the example in this post, if the fields selected in a JQL filter are not available for functions, comparisons, or sorting, what do they evaluate to: null, empty string, ???  This could explain several open JQL, report, and multi-project board symptoms.

Thanks, and kind regards,
Bill

Sheri Maxim September 29, 2021

@Andy Heinzer  thanks for the response and explanation. I'll track the reported bug. 


Regards,
Sheri

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 30, 2021

@Bill Sheboy I initially had the same suspicion that fields that might have a null value could be the cause here, such as parent.  However when testing the order by with only the status field, I found I could still replicate the behavior.  So the potential of null values are not the cause of this.

Instead I believe this is happening because of the nature of team managed projects in regards to how fields like status are not the global context field like they are in Company managed projects.

Like Bill Sheboy likes this
Bill Sheboy
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.
September 30, 2021

Thanks, Andy.  I look forward to learning how this can be improved over time.  Certainly any unexplained search results create work for customers and the support team answering their questions.

Suggest an answer

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

Atlassian Community Events