Get failure condition of all projects or a single project

Hi Team,
is there any api do we have to get the failure conditions for all projects or a single project?

for better understanding, please refer the below screenshot.we need to get failure conditions through api or please also suggest any alternative do we have apart from sonar cloud ui.

Thanks,
Revanth

Hey @revant

Configuring a webhook will send a payload with all failed conditions to an external system.
GET api/qualitygates/project_status will also show the failed conditions of a project/branch/pull request.

// https://sonarcloud.io/api/qualitygates/project_status?projectKey=nodejs-on-azdo
{
   "projectStatus":{
      "status":"ERROR",
      "conditions":[
         {
            "status":"OK",
            "metricKey":"new_reliability_rating",
            "comparator":"GT",
            "periodIndex":1,
            "errorThreshold":"1",
            "actualValue":"1"
         },
         {
            "status":"ERROR",
            "metricKey":"reliability_rating",
            "comparator":"GT",
            "errorThreshold":"4",
            "actualValue":"5"
         },
         {
            "status":"OK",
            "metricKey":"new_security_rating",
            "comparator":"GT",
            "periodIndex":1,
            "errorThreshold":"1",
            "actualValue":"1"
         },
         {
            "status":"OK",
            "metricKey":"security_rating",
            "comparator":"GT",
            "errorThreshold":"4",
            "actualValue":"1"
         },
         {
            "status":"OK",
            "metricKey":"new_maintainability_rating",
            "comparator":"GT",
            "periodIndex":1,
            "errorThreshold":"1",
            "actualValue":"1"
         }
      ],
      "periods":[
         {
            "index":1,
            "mode":"days",
            "date":"2020-05-14T15:32:58+0200",
            "parameter":"30"
         }
      ],
      "ignoredConditions":false
   }
}

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.