The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Jack Nolddor [Sweet Bananas]
Atlassian Partner
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]
Atlassian Partner
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.

TAGS
AUG Leaders

Atlassian Community Events