问题
I am working on a requirement where we need to generate issues reports and export them in excel. The number of issues that are generated in the project exceed the limit of 10,000 records that are allowed by sonarqube API. I want to get all the issues and export them but when I try to get more than 10,000 records I get below response:
{
"errors": [
{
"msg": "Can return only the first 10000 results. 12000th result asked."
}
]
}
This makes sense as the API has a limit to return first 10,000 issues. Request URL is http://localhost:9000/api/issues/search?pageSize=100&componentKeys=aug06_01&p=120 where p=pageNumber
Is there any workaround by which I can get all the issues?
回答1:
When there are more than 10000 results, the only way to get the rest is to split your query to multiple, more refined queries with more strict filters, such that each query returns less than 10000 results. And then combine the query results to obtain your complete target result set.
This limitation to 10000 results applies to web services that are backed by ElasticSearch index, and there’s just no way around it.
回答2:
As reported by the error, it's not possible to browse more than 10.000 issues. You need to refine your search.
来源:https://stackoverflow.com/questions/51857995/how-to-get-more-than-10-000-issues-on-sonarqube