It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to get all the issues from all the projects through REST API

Hi,

I'm doing a project for my internship were I need to collect all the issues out of Jira.

So I have done research to the documentation of the REST API from Jira and saw there is no endpoint to get every issue that exist in the Jira server.

Now I have been thinking of a possible solution to get every issue:
1. get every project key (/rest/api/2/project)
2. get from every project the issue keys (rest/api/2/search?jql=project%3D{projectKey})
3. get every issue connected with the issue key (/rest/api/2/issue/{issueKey})

 

But the problem I found with this method is that for example if you have 22000 tickets,

The program does more then 22000 calls to the Jira REST API to get them all.

 

Now is my question,
Is there another way possible to get every issue that is logged in Jira?

 

Thank you for helping

1 answer

1 accepted

1 vote
Answer accepted
DPK J Community Leader Sep 13, 2019

@Niels Molmans 

You are on right track, and you will need to use option 2 i.e. search api.

So you will call /rest/api/2/search but you will not pass any JQL to it, and it will return all issues.

Remember, search is paginated api and it has max result limit for single call.

DPK J Community Leader Sep 13, 2019

@Niels Molmanssearch will not require you to make 22000 calls for 22000 issues. It will be 22000/max_per_search which is usually set to 1000, so 22000/1000.

If you are looking for ways other then REST api,

  1. You can SQL Database, there will 'jiraissue' table that contain basic issue data,
  2. You can do that using Java API, if you are writing plugin.

With the search api you don't get the comments that are connected with the issue.
So then I need to look how I can get those also.

 

The SQL Database is also a possibility.
Then I have to research what the database structure looks like.

DPK J Community Leader Sep 13, 2019

@Niels Molmanshave you tried adding 'comment' to 'fields' parameter. This will give you comments in search api.

 

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

Thank you,
That worked for me!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Jira Cloud for Google Sheets: Automatically Refresh Your Data!

Remember that time you realized it was possible to refresh your Jira data in Google sheets with just one click? What if we told you that you can now get the latest data with no clicks at all?! Zero! ...

7,365 views 33 29
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you