Use REST API to return results of filter?

While trying to find a workaround for the problem I have as described in the question How to proper write complex JQL-query for the REST-api (double qoute problem for custom fields) I was hoping that it was possible to trigger a filter using the REST API and by that getting the same results returned as I would by triggering the same JQL search using the API. And by doing so, not needing to bother about escaping qoutes and all that stuff.

But reading the documentation https://docs.atlassian.com/jira/REST/server/ I have not been able to figure out if this is possible.

Am I right when concluding that I cannot get the results of the filter using the REST API, it is only possible to create/update etc. the actual filter, not getting the results.

2 answers

This widget could not be displayed.

It is possible, the example you have probably seen at https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-query-issues works fine - it returns a list of issues that match the filter you give it.

There's a working example for both get and post on that page, and I suspect you are right about the post being slightly easier to form on a Windows box.

I'm afraid the "workaround" for the problems you're having is simply that you need to get the escaping correct.

Nic - not sure if I follow - yes, I have seen the examples, but if I'm not totally mistaken they are all based on sending a JQL-search string. So I do not fully understand when you say "...it returns a list of issues that match the filter..." But, if you by filter mean JQL search string and not a saved filter in JIRA I do follow. And based on the last comment I do think that you mean just that.

This widget could not be displayed.
Joe I'm New Here Apr 23, 2018

I have the same problem, if I add a saved filter in JIRA like this:

...

CURLOPT_URL => $this->jiraServer . '/rest/api/latest/search?filter=59400',

...

it returns nothing.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Aug 06, 2018 in Jira Service Desk

A is for Activate: Share your top Jira Service Desk onboarding tips for new users!

Hi, everyone! Molly here from the Jira Service Desk Product Marketing Team :).  In the spirit of this month's  august-challenge, we're sourcing stories of Jira Service Desk activation fro...

576 views 25 15
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you