Hi,
I want to retrieve the result of a saved filter through the REST API using /jira/rest/api/2/search. The filter definition contains an ordering by resolutiondate (I test also id). If I change the direction from ASC to DESC the order changes in the Jira UI but not in the json object returned by the REST call. Why? How can I retrieve an ordered result through REST?
Thanks!
Tuelle
@Thorsten Twellmann, Can you try adding the extra query parameter to your REST call which you want to order by as like below:
?orderBy=-resolutiondateTo order by "resolutiondate" descending
?orderBy=-resolutiondate
To order by "resolutiondate" descending
Hope this helps you. Thanks.
Thanks for the tip, but this does not change the behavior.
Did you tried something like:
/rest/api/2/search?jql=project=TEST and status=closed&orderBy=-resolutiondate
If it does not work for you please post the rest call what exactly you were trying.
I was trying
http://127.0.0.1:2990/jira/rest/api/2/search?jql=project=TEST%20and%20resolution%20is%20not%20empty&orderBy=-resolutiondate
and
http://127.0.0.1:2990/jira/rest/api/2/search?jql=project=TEST%20and%20resolution%20is%20not%20empty&orderBy=resolutiondate
Both return a list of issues in the same order
As a workaround you can use:
/rest/api/2/search?jql=project = TEST and resolution is not empty ORDER BY resolutiondate ASC&orderBy=-resolutiondate
Please try it and let me know.
It looks like you're new here. Sign in or register to get started.