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

Niels Molmans September 13, 2019

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
DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 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.

DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 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.
Like Larry Curran likes this
Niels Molmans September 13, 2019

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.

DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 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

Niels Molmans September 13, 2019

Thank you,
That worked for me!

Suggest an answer

Log in or Sign up to answer