Can we post a message to Sonarqube Server from Local using any API's?

Hello Team,

We are trying to analyse, is it possible to post a message/comment for any new issue detected in our local dev branch (Git repo ) To Sonar qube server when we try to analyse using Sonar scanner, So that record of that issue is documented sonar qube server and while commit to main branch analysis that message or comment reference can be useful to Architects.

Anything like REST API to post comment on new issue detected to Sonar qube server that needs False positive or other exemptions later when actual code commit happens to master/main branch from local dev branch those comment can be referenced.

We are speaking in terms of development who does local analysis first and do not mean set FP from local, We just need record the comments for issue from developer to sonarqube central server while analysis?

Regards,
Titu

Hello @titukp12,
You can use the web api available in SonarQube to manage issues.
An issue has to be created before you can manage it, so you have to wait for the analysis and the background task to be finished before playing with the api.
You can find the available methods for the issues api at the following url:
http(s)://your_root_url/web_api/api/issues?query=issue
Alex.

Hello Alex,

Thanks for your response.

For Issue API, We observe that for Enterprise edition the Response doesn’t have Branch name details for the Issue generated when we run branch analysis, We are trying to align all the issues generated with Sonar project along with branch name but not able identify which issue has come up from which branch since two feature branch can have same issue on same file.

Any API to get Branch name in response with respect to Issue key?

Hello Alex,

In short, For Sonar Enterprise Edition or Developer edition can we get thru API calls all issues of Master, Short Lived and long lived Branch?

Currently below API fetches only issues of Master Branch, This Sonar Enterprise Edition - Version 7.9.1

https://sonar-host-url/api/issues/search?

Regards,
Titu

Ignore this request.

I got it, Thanks Alex