Alternate REST API calls to issues endpoint results in an empty list inspite of issues being present

Hi,

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?

Regards,
Vishwas Shetty

We are having the same issues, also tried cache busting and highest level of authentication means.

Hi @vishwas.shetty and @yuksel , welcome to the community forum.

I would like to clarify what you mean exactly by:

I’ll be making this call 8 times

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?

@Claire_Villard

if the total no of issues are 4000, and the page limit is set to 500. Then I would need to make the call to 8 times to get all the 4000 issues.

Yes, we are increasing the p parameter from 1 to 8 in the above case.

Can you please point me to the public project?

Endpoint: /api/issues/search?componentKeys={id}&p=1&ps=500

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.

Hi Claire,

The issue doesn’t seem to be related to pagination or issue count.

I have provided screenshots here

Hi @yuksel

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.

1 Like