I’m trying to fetch the issues for a given project id using:
/api/issues/search?componentKeys={id}&p=1&ps=500
and if the total no of issues is 4000, so I’ll be making this call 8 times and every alternate calls I make to the above endpoint results is the following response inspite of it having issues
{
“total”: 0,
“p”: 1,
“ps”: 500,
“paging”: {
“pageIndex”: 1,
“pageSize”: 500,
“total”: 0
},
“effortTotal”: 0,
“debtTotal”: 0,
“issues”: ,
“components”: ,
“facets”:
}
I have tried running this using Postman & Curl command on the terminal. Same behavior.
Any particular reason I’m facing this?
Any workarounds?
What are exactly the calls you make to the API, for all the pages? Are you increasing the p parameter to get the following pages?
Could you reproduce that behavior with a public project and share its link here, for us to investigate?
Sorry for not being clear.
I can’t reproduce the issue. Fetching several thousands of issues by pages of 500 using that endpoint works perfectly fine for me, all pages have the expected results. I used cURL commands to test, like this one:
curl -X GET -i -H "Content-Type: application:json" -u thetoken: 'https://sonarcloud.io/api/issues/search?componentKeys=theprojectkey&p=4&ps=500'
Therefore, to investigate, I need you to provide:
a public SonarCloud project with several thousands issues (you can also use any public project already existing on SonarCloud, as soon as you tell me which one it is)
the exact commands you use to reproduce the issue on that public project.
It seems you are using SonarQube.
This thread is for SonarCloud, they are 2 different products. I can’t help you on SonarQube issue and I see your other thread has already received some attention from SonarSourcers. I hope you’ll find a solution there, but since the problem seems to be hard to reproduce, I think it is better if we keep them separated by product, unless of course you also use SonarCloud and can build the reproducer we need.