JIRA API token : Is it possible to get saved filters data in JSON format using CURL

mansoornarikuth August 8, 2019

I have created and saved a filter and got the filter ID. The JQL query I used as below.

 

 "Time to first response" <= remaining(30m) AND "Time to first response" != breached() AND issuetype = Incident AND project =xxxx

 

Is it possible to get the saved filter details as a JSON format using CURL and API token? 

 

I tried with below query. But, it's not working.

 

curl --request GET --url https://site-url/issues/?filter=44229 --user 'API token' --header 'Accept: application/json'

1 answer

0 votes
Jack Nolddor _Sweet Bananas_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
August 8, 2019

Hi,

You can use Search REST API to do the trick

Note that REST API calls for JQL is paginated and does not return all issues with al single call.

 

This will work on Jira Server:

curl -X GET -u "user:password" -H "Content-type: application/json" -H "Accept: application/json" http://localhost:8080/rest/api/2/search?maxResults=1000&expand=all&jql='filter=44229' -k -vvv

 

 

See:

The maximum number of issues to return (defaults to 50). The maximum allowable value is dictated by the JIRA property 'jira.search.views.default.max'. If you specify a value that is higher than this number, your search results will be truncated.



Regards

mansoornarikuth August 9, 2019

Hi  jack,

 

I will check this and update here.

Jack Nolddor _Sweet Bananas_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
August 9, 2019

That would be really great!
Thanks

mansoornarikuth August 19, 2019

Hi Jack,

 

Sorry for the late reply. I have tried the curl command and it's producing the JSON data. But the problem is, I have mentioned the specific project name and organization in that filter. But, when I checking the JSON data, it's also included other project data too. Do you have any idea why this is happening?

Please note that when I run this filter from JIRA UI, I'm getting the correct answer.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events