-1

if anybody knows please give me sql query or idea, I am not able to find common thing for getting bug count from projects_measures and projects table.

Ankit Patel
  • 31
  • 1
  • 6

1 Answers1

2

You can use this curl request:

curl <SONARQUBE_URL>/api/issues/search?ps=1&projectKey=<PROJECT_KEY>&facets=types

by using facets=types you will get the number of issues by type (bugs, code smells and vulnerabilities).

begarco
  • 751
  • 7
  • 20
  • Hello Begarco, I have two project , even if I mentioned diff project key in my api query it still prints the same value, can you help me how to filter it out project specific, i tried to remove ps from as well but no luck curl -u admin:XXXXXXX -X GET 'https://mysqserver.com/sonarqube/api/issues/search?ps=1&projectKey=reactjs-demo&facets=types' , one project has 3 bugs and other has 34 bugs but it always prints 34 bugs for both project , can you guide – Samurai Sep 08 '22 at 05:47
  • What is the version of your SonarQube instance ? – begarco Sep 09 '22 at 08:01
  • 1
    Hello Begarco, I have figured it out, I will using wrong parameters :) – Samurai Sep 13 '22 at 05:54