Jira Cloud
Issue:
REST API is ignoring 'order by' parameter. Following return result in the same order. Filter is: Key IN (PROJ-1, PROJ-2, PROJ-3). Sorting on other fields is ignored as well. Return result is always sorted on descending Key.
Tried this format as well. Same result.
Documentation does not mention order as an option. Has this been deprecated or I am making an incorrect request? How can I sort on Key?
Using JQL directly (instead of filter=12345) returned the same result.
Thank you.
Hi @Saeed
I haven't used a filter in an API query, but I feel the issue might be that the sorting should be in the filter itself. Your orderBy statement isn't part of the jql= section and the API call for search doesn't (and never did) support orderBy.
So I believe there are 2 ways to correct this :
Thank you @Warren. Defining sort key/order in the saved filter is ignored as well. Jira server version ignores order in the saved filter and it is required adding it to the GET params. This, on server version, has worked for the past 4 years for us. We have moved from server to cloud and that does not work anymore.
Per your suggestion, I used the JQL directly in the call. That worked. However, it is not a viable option for us since the saved filter is used in a few places and changes regularly.
One more observation: Using the same saved filter in Google Docs's Atlassian add-on works fine.
I would appreciate all suggestions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Warren - Resolved.
"=" in filter=12345 must be encoded.
ORDER BY in GET overrides the one in the saved filter (if any). Correct behavior IMO.
To be on the safe side, I'm now encoding the entire parameter instead of using +
zzz.atlassian.net/rest/api/3/search?jql=filter%3D12345%20ORDER%20BY%20key%20ASC&fields=key
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.