Get a list of all the project with failing Quality Gate

  • Version used: SonarQube 7.9 LTS
  • What I want to achieve: get a list of all the projects with Quality Gate status = “ERROR” on the last analysis
  • How I’ve done it using the Web API:
    • GET api/projects/search to get a list of all the projects and then, for every project:
    • GET api/qualitygates/project_status

Is there a better way to achieve my goal?
Can I somehow get the current Quality Gate status information for every project without having to loop every one of them?

Thanks to everyone that will answer me.


Have you tried this via the UI? The best way to master the API is to perform the desired action via the UI and eavesdrop to see which calls the UI made to accomplish the action. In this case, you’ll find there’s a Quality Gate status filter on the Projects page, so I suspect what you want can be accomplished in one compact call.