Forums

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

Sorting number fields in descending order. Null values appear first? That's weird

Jim Hathaway August 8, 2025

I have a number field that I want to user order by desc in a JQL query.

Most records are populated with a number but some are empty. the search results appear to sort the empty/null values first, then high numbers to low numbers.

This is counterintuitive. Empty or Null values should be in the same place as Zero or below the lowest number, not at the top.

Can I fix this with some clever query or is it not working the way I expect it to and Atlassian need to fix it.?

2 answers

1 vote
John Funk
Community Champion
August 8, 2025

Hi Jim - Welcome to the Atlassian Community!

Any reason to not default the field to 0?

Do you need to see the work items without a value? You could exclude those in the query. 

Not sure why it is showing the null values first. Does DESC put them at the end? 

Jim Hathaway August 11, 2025

Thanks for the reply. Yes, I need to see the work items with empty values, just at the bottom of the sorted list, not the top.

The value is for CVSS Score. Anything from 0 to 10 is a valid value but for some things CVSS is Not Applicable and this has been left empty.

Looks like I'm going to have to bulk-update everything that's empty to a  -1 :-(

John Funk
Community Champion
August 11, 2025

Definitely a route to go. You should also open a support ticket with Atlassian to see if this is a bug. 

https://support.atlassian.com/contact/#/

0 votes
Hannes Obweger - JXL for Jira
Atlassian Partner
August 10, 2025

Hi @Jim Hathaway

welcome to the community!

I agree with you that the sorting behavior is unexpected - however apart from John's suggestion above, I'm not aware of any ways to work around this in native Jira.

This being said, if you're open to solutions from the Atlassian Marketplace, you have more options available. E.g., this would work as expected in the app that my team and I are working on: JXL for Jira.

JXL is a full-fledged spreadsheet/table view for your issues that allows viewing, inline-editing, sorting, and filtering by all your issue fields, much like you’d do in e.g. Excel or Google Sheets. It also comes with a number of advanced features, including support for (configurable) issue hierarchies, issue grouping by any issue field(s), sum-ups, or conditional formatting.

Plus, of course, it sorts number fields just like to described:

number-sorting.gif

This just works - there's no changes to your data whatsoever required.

Any questions just let me know,

Best,

Hannes

Jim Hathaway August 11, 2025

Thanks for the reply, the last time I tried to get something from Marketplace added into our Jira, the approval process took 9 months. I don't want to have to go through that again.

Suggest an answer

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

Atlassian Community Events