I could not able to fetch the quality gate id in powershell using any of the web api endpoints available.
Hi,
Welcome to the community!
What have you tried?
Ann
Hi Ann,
I am just trying to fetch the quality gate details using powershell script. It is returning the gate name but not returning the gate id.
The below is the GET method script which I have used.
$apiEndpoint = “$sonarQubeUrl/api/qualitygates/get_by_project”
This gateId is needed to run our pipeline script in ADO. The below is the azure devops script where we used gateid.
$url = $sonarBaseUrl + ‘qualitygates/select?organisation=&gateId=&projectKey=’ + $repoName;
This above script was running successfully but now it is not working
Hi,
Are you using SonarQube Cloud or SonarQube Server / Community Build?
Also, 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.
You may also find this guide helpful.
Ann
Hi Ann,
we are using sonarqube server. I have tried to see the gateid via UI. But I could not find it.
Hi,
Take a look at the data returned by the calls where the gates are shown. I’m betting they’ll include IDs.
HTH,
Ann