Forums

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

How to export all issues from JQL via API

Deleted user July 11, 2023

My JQL:

assignee = currentUser() AND resolution = Unresolved order by updated DESC

How can I export all issues returned from above JQL to CSV file using Jira API?

1 answer

1 accepted

0 votes
Answer accepted
Rudy Holtkamp
Community Champion
July 11, 2023

Hi @[deleted] ,

Take a look at this End Point: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-search-get

curl --request GET \
--url 'https://your-domain.atlassian.net/rest/api/3/search?jql=project%20%3D%20HSP' \
--user
'email@example.com:<api_token>' \
--header
'Accept: application/json'

So in your case the URL should be:

https://your-domain.atlassian.net/rest/api/3/search?jql=assignee%20%3D%20currentUser()%20AND%20resolution%20%3D%20Unresolved%20order%20by%20updated%20DESC

This will get you a JSON response, which you need to format in a CSV style

Deleted user July 11, 2023

In our URL we do not have atlassian.net

We have this: https://jira.OurCompanyName.com/

Will that be ok?

Rudy Holtkamp
Community Champion
July 11, 2023

Ah, sorry thought that you had Cloud.

For server/dc you need to look here. 

Which will lead to:

https://jira.OurCompanyName.com/ rest/api/2/search?jql=assignee%20%3D%20currentUser()%20AND%20resolution%20%3D%20Unresolved%20order%20by%20updated%20DESC

Note the '2' instead of the '3'

Deleted user July 11, 2023

So can I use below code?

curl --request GET \
--url 'https://jira.OurCompanyName.com/ rest/api/2/search?jql=assignee%20%3D%20currentUser()%20AND%20resolution%20%3D%20Unresolved%20order%20by%20updated%20DESC' \
--user
'email@example.com:<api_token>' \
--header
'Accept: application/json'
Deleted user July 13, 2023

I am getting below error message.

curl: (3) URL using bad/illegal format or missing URL
curl: (6) Could not resolve host: application

 

I used below command on command prompt.

curl --request GET --url 'https://jira.xyz.com/rest/api/2/search?jql=assignee%20%3D%20currentUser()%20AND%20resolution%20%3D%20Unresolved%20order%20by%20updated%20DESC' --user 'ABC4:NDk5MTE1MjY4MjQxOniPtwg7' --header 'Accept: application/json'
Rudy Holtkamp
Community Champion
July 13, 2023

If you use a cmd on Windows, use double quotes (") instead of the single quotes (') which surround the url, user and header

Deleted user July 13, 2023

Thank you. I was able to run below command that shows JSON response on command prompt.

curl --request GET "https://jira.XYZ.com/rest/api/2/search?jql=assignee%20%3D%20currentUser()%20AND%20resolution%20%3D%20Unresolved%20order%20by%20updated%20DESC" -H "Accept: application/json" --user "JiraUid:JiraPwd"

When I run above JQL directly in Jira it shows three columns (Summary, Status and Epic Link).

How do I extract these three columns and their values from curl JSON response?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events