In me team, we are using Sonarqube web api to fill a dashboard with different metrics.
With Sonarqube 5.6, we have a dashboard which lists projects with quality gate in ERROR.
To achieve this we are retrieving all the projects and filter them by there name which contains the branch name.
With Sonarqube 7.x and the new branch system (which is great) I don’t know the best way to achieve the same behaviour.
The simplest way is :
- use api/components/search to retrieve all the component
- then use api/measures/component or api/project_analyses/search with the branch parameter to retrieve status one by one
But it will spam the Sonarqube server each time the dashboard is refreshed…
I’ve found that we can use /api/components/search_projects?filter=alert_status%20%3D%20ERROR to retrieve project with a particular status.
It’s exactly what I need
But there is no branch parameter available
Is there an other way to achieve this ?