Inconsistent paginated API search result while using JQL

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

In certain situations, Jira might show inconsistent results when searching for tickets using its API that includes duplicates. For example , when using api/2/search and the number of results exceeds 1000 or maxResults variable, it is possible to find duplicate results in page 1 and page 2 or any consecutive page.

The same behavior is also seen when making the search against a data center installation base URL, if the requests for page 1 and page 2 go to different nodes some of the results might appear as duplicates.

Environment

Jira 7,8,9 

Diagnosis

  • The returned issue keys are not unique across the API result pages.

  • In the case of a data center installation, index replication must be working with no problems and the healthcheck is not failing.

Cause

Jira pulls different pages results if :

Solution

  • Add a second sorting criteria to the JQL clause for example , we added id to the clause ORDER BY "End date",id desc  to keep tickets in order and avoid showing results on different pages

  • In a data center installation, it is preferred to use

Updated on March 13, 2025

Still need help?

The Atlassian Community is here for you.