Yunter
Yunter

Reputation: 284

Sonarqube API - Getting quality gates by "name" value instead of Id

Is it possible to identify quality gates/projects by name, rather than ID? Docs

For example, the following curl will return the quality gate with ID of "806":

curl -u user:pass -X GET "<domain>/api/qualitygates/search?gateId=806"

However, I want to get the quality gate by name. Something like:

curl -u user:pass -X GET "<domain>/api/qualitygates/search?gateId=<NAME>"

 

"gateID" is required and requires an integer value so I can't replace this with "name".

I'm using version 4.5.5

EDIT: I've found you can get quality gates by name by hitting the following endpoint:

/api/qualitygates/show?name=

I now just need assistance to get a project by name

Upvotes: 0

Views: 827

Answers (1)

Sagar Ravkhande
Sagar Ravkhande

Reputation: 11

You can try like this,

curl -u user:pass -X GET "<domain>/api/qualitygates/select?projectKey=<NAME>&gateName=<GATE-NAME>"

Upvotes: 0

Related Questions