Hello,
I have a customfield that specifies different date increments (from 2020), no matter how I sort, the JQL always displays the oldest dates first .. .
Is there a way to fix this and make sure the JQL displays the field values exactly how I sort them ?
First off, what is the searcher of the custom field?
Look at custom fields - find it, click edit, the searcher is listed there.
Based on some of the values you posted in comment replies, I assume it is most likely a text searcher, or an option searcher.
Searchers typically work on how the values are stored.
If this was a date, imagine it as a milliseconds, lowest to highest, highest to lowest, no problem.
If this was a string, i.e. text, it will go character by character, from the first character, to the second, to the n, and if the character (which itself is a numeric value), lowest to greatest, greatest to lowest, etc. Same thing, but it goes character by character.
^ this also applies to custom field values if your field is an option field
Now, what will happen if your values are:
9 X
19 X
20 X
Ascending, this would be 19, 20, 9 -- because it goes character by character, despite you knowing that 9 is less than 19.
If you use something called "natural" search or order (https://en.wikipedia.org/wiki/Natural_sort_order) then it will produce 9,19,20 because it takes care to treat numbers as whole, not by single character.
So I reckon, that you are using a searcher for the custom field, which probably doesn't care about the date at all, rather it cares about the sequence of characters in the values.
@Radek Dostál Thank you for the detailed explanation. The searcher for the field is 'Multi Select searcher" . .
I want to add that while editing the issue, the sorting is exactly how it is configured. Only when querying in the JQL it lists the older values first
Is there any way this could be sorted so that the JQL searcher displays the field in the order of 2025,2024,2023,2022 ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not without a "special" searcher, which I don't think I know of any.
If I understand how option searchers work then the only choice you have I'd say is to ensure that each value is in the same format.
E.g. always using 0's in case of 2-digit values, i.e. 01, 05, so that 11 and 25 are all in the correct order when sorted. Always using 4 digits for years, etc. So that indeed the sorting goes character by character and cannot fail on something missing between the values.
As a thought, just changing the value won't help, because it will need to re-index the values for jql to pick up on it (a single project re-index should work, but if you're using this with many then a full re-index will be better).
Without modifying the values, like I said it would need a custom searcher, one that Jira doesn't have natively (as far as I'm aware). It would have to supplied by a plugin, and associated with the field, some custom searcher that will treat the values in the "natural" order.
Just to be clear - the order of values in the context is ignored, it's just the values themselves.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, you are right. I looked at the values and it is most probably sorting the values by the fourth character
PI 20.1
PI 21.1
PI 22.1
PI 23.1
PI 24.1
So based on this, the older years is coming first
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Aisha M
could you kindly provide a screenshot of what you are seeing in Jira, along with what you'd expect to see?
Thank you,
Best,
Hannes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the reply !
The field is a Select List field with values as below,
I have sorted this list from 2025 - 2019 in the custom field
But, when I search for this field using the JQL, the values displayed start with 2019, it does not display the values as how it been sorted in the customfield configuration.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Aisha M ,
you should be able to sort jql result just clicking on a specific column and define order for that. Isn't it?
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for the reply ! I not talking about the JQL result, but the field values displayed while using a JQL
The field is a Select List field with values as below,
I have sorted this list from 2025 - 2019 in the custom field
But, when I search for this field using the JQL, the values displayed start with 2019, it does not display the values as how it been sorted in the customfield configuration.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.