Web API docu is outdated (?)

I’m trying to use the Web API and I think the documentation is outdated.

First of all, I find it very difficult to figure out whether I’m supposed to use V1 or V2. Since I couldn’t find anything related to ‘issue’ in V2, I assume V1.

Doing a curl -s -u “TOKEN:” https://sonarcloud.io/api/server/version gives me merely ‘8.0.0.7924’, which is not helpful either :wink:

Now to my concrete complaint: the docu for api/issues/search (
SonarQube Cloud) says:

whereas the API returns:
“Value of parameter ‘statuses’ (C) must be one of: [OPEN, CONFIRMED, REOPENED, RESOLVED, CLOSED]”

Needs an update, I guess… unless this is part of V2 and I was looking at the wrong docu.
And how come FALSE_POSITIVE is not an option? I thought only FIXED and CONFIRM are deprecated (according to the user interface). So what about “ACCEPT”? Does that then set the status to ‘CONFIRMED’?

BTW, the server reply for do_transition is: “Value of parameter ‘transition’ () must be one of: [confirm, unconfirm, reopen, resolve, falsepositive, close, wontfix, accept, resolveasreviewed, resolveassafe, resolveasacknowledged, resetastoreview]” — so here the docu seems up-to-date.
I have to say, I’m having very hard time mapping these to the state diagram shown here in the docu: Issue management solution | SonarQube Cloud | Sonar Documentation. I guess ‘RESOLVED’ is when issues are either ‘false positive’ or ‘accepted’

Hello Lorenz,

These are two different parameters: ‘issuesStatuses‘ and ‘statuses‘.

In fact ‘statuses‘ is deprecated, but if you turn on ‘Show Deprecated API‘ flag you will se it:

And when you use ‘issueStatuses’ parameter in the query you will get the correct response:

{"errors":[{"msg":"Value of parameter 'issueStatuses' (OPENN) must be one of: [OPEN, CONFIRMED, FALSE_POSITIVE, ACCEPTED, FIXED]"}]}

Hope it clears up the confusion.

1 Like

Thank you, Alexander!
I really was using the deprecated statuses in my query, but was looking at the docu of issueStatuses :man_facepalming: :laughing:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.