Inconsistent pagination in SonarQube 9.9 Issues Search API when issues have the same creationDate

We are using SonarQube version 9.9 and experiencing inconsistent pagination behavior with the issues/search API.

We fetch issues using ps=100. Due to the 10,000 issue limit, after every 10,000 issues we reset the page number and continue fetching by using the last fetched issue’s creationDate with a createdAfter approach.

However, some issues have the same creationDate. Because of this, the API does not seem to return stable pagination results. For example, page 42 returns issues, page 43 returns an empty issue list, but page 44 returns issues again.

Example:

Page 42 -> returns issues
Page 43 -> returns empty issues list
Page 44 -> returns issues

This causes a risk of missing issues in our integration, because an empty page may be interpreted as the end of the result set.

We are also using the s parameter to sort by creation date, but the pagination result still seems inconsistent when multiple issues have the same creationDate.

Could you please clarify:

  1. Is this expected behavior in the issues/search API?

  2. How does the API guarantee stable pagination when multiple issues have the same creationDate?

  3. Is there a recommended way to use a secondary stable sort field?

  4. Is using createdAfter after each 10,000 issues the correct approach?

Example endpoint format:

/api/issues/search?p=43&ps=100&s=CREATION_DATE&createdAfter=...
/api/issues/search?p=44&ps=100&s=CREATION_DATE&createdAfter=...

Thank you.

Hello @Muhammet_A,

Welcome to the community! Thanks for the report.

SonarQube v9.9 is no longer an active version. Please reproduce this on a current active version before we can look into whether this is a current product problem.

Please update and let us know whether you still see the same behavior. If it persists after upgrade, please come back to us with the exact version you tested on and the full request pattern you used to reproduce it.

Note that you can use the following Web API endpoint, GET api/projects/export_findings, to get all findings (issues and hotspots) of a specific project branch. Since this endpoint retrieves findings directly from the database, it is not limited to 10,000 results.

Cheers,

Stevan