How can we set the search api to respect the issue filter order?

Mark Matchynski October 31, 2023

I am trying to use this API:

https://docs.atlassian.com/software/jira/docs/api/REST/7.6.1/#api/2/search-search

I pass in ?jsql=filter=1234 where 1234 is my issue filter that has issues in a particular order using an order by clause.

I get back the issues from that filter but not in the order that the issue filter has specified in it's order by clause.  The order is important to us.

2 answers

0 votes
Mark Matchynski November 3, 2023

Adding the order by worked for me. 

 jql=filter%3D1234%20ORDER%20BY%20key%20ASC  (this one respects the order provided)

But if it's in the filter already shouldn't it come back for this too?

  jql=filter%3D1234  (this one does not use the filter's order)

The problem is what if we don't know the order by to add to the api but the filter does know the order by.

Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 4, 2023

I see, unfortunately this is the only workaround I have :( 

0 votes
Tuncay Senturk
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 1, 2023

Hi @Mark Matchynski 

Have you tried encoding "=" in the URL?

  jql=filter%3D1234

I am not sure but adding "order by" to the URL might also help you fix the problem

 jql=filter%3D1234%20ORDER%20BY%20key%20ASC

Suggest an answer

Log in or Sign up to answer