Query to get all the issues for the project and branch

Hi,

I am using SonarQube 8.4.1.
I am trying to query the SonarQube database built in MS SQL while setup.
I am trying to get all the issues for the specific branch form SonarQube Database, but I could not able to find the relation b/w table [issues] and [project_branches].
Is there any way I can relate it. Pls help.

My Query:


SELECT * FROM [Sonar].[dbo].[issues] A WHERE [project_uuid] = 'AXdipD_NY7hCULFc3iP2'

– Where AXdipD_NY7hCULFc3iP2 is my project id from table [projects]

I also need condition with respect to specific branch. I dont want to use API for now. I need this info for some purpose.

Thanks in advance.

Hey there.

We do not recommend directly querying the SonarQube database (and could not provide support in doing so). The most sensible way to pull information out of SonarQube is to use the Web API (documentation linked in the footer of your instance).

Specifically, you probably want to look at the api/issues domain of Web APIs, including GET api/issues/search.

You might also find this guide useful: