Questions tagged [sonarqube-api]

The SonarQube HTTP api allows to access SonarQube functionality via a json or protocol buffer interface.

42 questions
11
votes
0 answers

Change main branch in Sonarqube without deleting branch

I am trying to change my main branch in Sonarqube from master to mainline as I have been doing my analysis on mainline for the past few months. This post below in the Sonar community says that I have to delete the mainline branch then rename the…
9
votes
3 answers

java.lang.IllegalStateException: Not a JSON Object

I am trying to get a json response from SonarQube using the SonarQube web API. While assigning the JsonElement into a JsonObject I am getting this error: java.lang.IllegalStateException: Not a JSON Object This is my Java class @Controller public…
revan
  • 93
  • 1
  • 1
  • 5
8
votes
2 answers

REST API for getting project last analysis date?

How do I get a project's last analysis time (the one you can see in the dashboard) with the REST API of SonarQube? I am working with SonarQube 4.5.6, but if it's only available on later versions I'd still be interested in how it is done.
Roy Ca
  • 473
  • 1
  • 3
  • 13
6
votes
2 answers

SonarQube 6.7 LTS group permissions API doesn't working

I'm migrating SonarQube from 5.6 version to 6.7. I'm using SonarQube API with my Jenkins jobs and the problem is the API for groups permissions isn't working with 6.7 version... I've tried manually with Postman (POST raw JSON) this : { …
user7769974
4
votes
0 answers

How to extract the all SonarQube projects analysis data into one excel file?

I am currently using SonarQube 6.4 to find issues in my code. We started using SonarQube 5.4 then we did SonarQube migration from 5.4 to 6.4. Our projects contain javascript and php code. We have performed analysis on these projects since 12 months…
Asmi
  • 651
  • 1
  • 8
  • 16
3
votes
1 answer

How to get Sonarqube Metrics (i.e. vulnerabilities: A; B; C; D; E) Ratings via the web api

Please assist with the above. I have successfully implemented a web api to sonarqube and I am able to get values for the metrics I specify in the web api (ref: https://gazelle.ihe.net/sonar/web_api/api/measures) The problem I have is, I want to get…
P. Sithole
  • 151
  • 1
  • 13
3
votes
1 answer

How to retrieve SonarQube metrics of previous build versions through the api?

How do I get the measures (like code-coverage, technical debt, complexity, nloc, ...) of a certain build version (eg. 1.0.0.20) from the api of SonarQube? My goal is to get these information and display it along with some-other info pertaining to…
Saurabh
  • 95
  • 2
  • 8
3
votes
1 answer

How to retrieve SQALE rating and Technical debt information?

I was looking at the web service API V5.5 documentation for SonarQube and would like to retrieve two things at the project level: SQALE rating Technical Debt Which API can I exactly use to get these values directly?
CSharped
  • 1,247
  • 4
  • 20
  • 49
3
votes
0 answers

How to avoid sql error, when deleting an event?

When I try to delete an event with the SonarQube REST API I get an error: {"err_code":500,"err_msg":"ActiveRecord::JDBCError: Unknown column 'scope' in 'where clause': SELECT * FROM snapshots WHERE (uuid = 'xxxxxxxxxxxxxxxx' AND scope = 'PRJ') …
Sebastian
  • 31
  • 1
3
votes
2 answers

How to check quality gate status for a project using the API?

I need to trigger HipChat notification for a project as soon as quality gate fails for a project in SonarQube. Is there a REST API for checking the quality gate status of a project. I couldn't find it under api/quailty_gate or api/projects. I am…
Jeel
  • 2,227
  • 5
  • 23
  • 38
2
votes
2 answers

How to use a union operator in SonarQube web services?

I would like to select from all the issues I have all the blocking issues and all the vulnerability issues, which are Blocker, Critical or Major. How can I do that in one request for SonarQube 6.4? If I…
Samorix
  • 307
  • 4
  • 17
2
votes
0 answers

Adding a comment when raising an issue in SonarQube

Using a plugin to raise issues such as: https://github.com/SonarSource/sonar-custom-plugin-example/blob/master/src/main/java/org/sonarsource/plugins/example/rules/CreateIssuesOnJavaFilesSensor.java I want to be able to add a comment to the issue…
ubergam3r
  • 189
  • 1
  • 3
  • 11
1
vote
0 answers

SonarQube API for Hotspots

I am trying to call the SonarQube API hotspot and am getting a 404 status code. I've followed the internal web api and generated this request to get the hotspot key. This would allow me to generate another request to get the hotspots for a…
Hemi81
  • 578
  • 2
  • 15
  • 34
1
vote
1 answer

Http 401 error while invoking api in Jenkins pipeline

I am getting 401 error while hitting sonar api from Jenkins pipeline but from postman I am getting proper response for same url with same credentials, however in Jenkins I am getting below error Response Code: HTTP/1.1 401 20:26:38 Response:…
1
vote
1 answer

SonarQube+Gitlab api authentication yml 401

I have a personal SonarQube (Latest LTS) and Gitlab (14.5.1) installation. I've set-up everything and login with Gitlab through the web interface is working. However, I'm looking for a way to login with gitlab credentials throught the SonarQube API.…
1
2 3