# Jira REST APIs not fetching all the issues

**URL:** <https://community.developer.atlassian.com/t/jira-rest-apis-not-fetching-all-the-issues/51917>\
**Category:** Jira Data Center\
**Tags:** pagination, java, rest-api\
**Created:** [September 10, 2021, 7:14pm UTC](https://community.developer.atlassian.com/t/jira-rest-apis-not-fetching-all-the-issues/51917 "2021-09-10T19:14:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AakankshaJain](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@AakankshaJain](https://community.developer.atlassian.com/u/AakankshaJain)\
**Post date:** [September 10, 2021, 7:14pm UTC](https://community.developer.atlassian.com/t/jira-rest-apis-not-fetching-all-the-issues/51917/1 "2021-09-10T19:14:33Z")

</div>

Hello, I am trying to fetch around 10K issues from Jira using Rest API using “maxResults” and “startAt” in JQL. While doing that I noticed that some of the records are coming twice and some records are not coming at all. Below is the JQL I am using. Has anyone faced the same problem or have any work around for this.

I tried reducing the batch size but still same behavior. Any help is much appreciated.

/rest/api/2/search?maxResults=1000&startAt=0&fields=issuetype,%20issuekey&jql=issuetype%20%3D%20Spike%20AND%20category%20in%20(%22Aligned%20Execution%22%2C%20%22Business%20Execution%22)%20ORDER%20BY%20created%20ASC

---

<div class="post-metadata">

**Author:** ![sfbehnke](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/sfbehnke/32/34486_2.png) [@sfbehnke](https://community.developer.atlassian.com/u/sfbehnke)\
**Post date:** [September 10, 2021, 8:09pm UTC](https://community.developer.atlassian.com/t/jira-rest-apis-not-fetching-all-the-issues/51917/2 "2021-09-10T20:09:30Z")

</div>

It’s possible the search indexes are not in-sync and you need to do a Full Re-Index on a cluster member and publish the indexes to the remaining nodes for consistency.

You can confirm this by bypassing any loadbalancer and targeting a single member at a time and comparing search results.

---

<div class="post-metadata">

**Author:** ![AakankshaJain](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@AakankshaJain](https://community.developer.atlassian.com/u/AakankshaJain)\
**Post date:** [September 13, 2021, 10:44pm UTC](https://community.developer.atlassian.com/t/jira-rest-apis-not-fetching-all-the-issues/51917/3 "2021-09-13T22:44:30Z")

</div>

Thank you so much @sfbehnke. Tried this and it resolved the issue for me.

---

<div class="post-metadata">

**Author:** ![sfbehnke](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/sfbehnke/32/34486_2.png) [@sfbehnke](https://community.developer.atlassian.com/u/sfbehnke)\
**Post date:** [September 14, 2021, 4:05pm UTC](https://community.developer.atlassian.com/t/jira-rest-apis-not-fetching-all-the-issues/51917/4 "2021-09-14T16:05:30Z")

</div>

Very cool. Glad to help, I’ve had some of my users (who are doing API development) report similar things. The inconsistency is caused because API requests are not getting a “session”, they aren’t getting stuck to a SINGLE node, they are getting round-robined from good node to bad node.

For the record, at SpaceX we do a weekly reindex over the weekend and get the indexes published around. I advise similar workflow for your teams using Jira Data Center.
