Sonarqube 7.7 Database model help needed

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) Sonarqube 7.7
  • what are you trying to achieve:
    Trying to design queries to pull False positive and Blocker data to Bespoke Dashboard
  • what have you tried so far to achieve this
    Tried querying but data model is not handy to check for all required attributes.

Sonarqube 7.7 data model (database ER Diagram) required or how can I get ?

Hi @singhnilesh12 ,

7.7 is EOL and you should at least upgrade to the current LTS version of sonarqube (7.9.6).

i honestly would not recommand that you interact with the database of sonarqube directly, as its structure can change with every release, resulting in you having to redevelop your solution over and over again. the better way would be to query our API and let us take care about the structure of the database.

with this warning in mind, we used an abstraction in this version, so there is no ER diagram or SQL for you to look at, but maybe these XML references will help you a little

Thank you Tobias, actually we are trying to see all the false positive being set for which all projects for what rules and by whom. At current I need to drill down in each project to check the same so we thought of get this data as dashboard so that it handy and available on the main dashboard. Any suggestion on how to fetch these data from by means of query or any other integrations will be help.

Hi @singhnilesh12 ,

sounds to me like you can make use of the api endpoint api/issues/search, so for example

curl -u admin:admin "http://localhost:9000/api/issues/search?s=FILE_LINE&resolutions=FALSE-POSITIVE&ps=100&facets=owaspTop10%2CsansTop25%2Cseverities%2CsonarsourceSecurity%2Ctypes&additionalFields=_all&timeZone=Europe%2FBerlin&p=1"

this would get you all issues (100 issues per page [ps=100], as we use pagination [p=1]) resolved as false positive. all required data except who marked the issue as false positive is included in this data.

hope that helps :slight_smile: