Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
- what are you trying to achieve
- what have you tried so far to achieve this
Hi Everybody,
I have SonarQube 8.9 and want to use the API to create Quality gates.
It works perfectly for those whose operator is greater than or less than (GT / LT).
For instance:
curl -X POST --insecure -u toooookeeeen: Code Quality and Code Security | SonarQube -d “gateName=theNAME” -d “metric=reliability_rating” -d “op=LT” -d “error=33”
But if i want to create a condition requiring ratings, such as A or B or C, it fails:
curl -X POST --insecure -u toooookeeeen: Code Quality and Code Security | SonarQube -d “gateName=theNAME” -d “metric=reliability_rating” -d “op=LT” -d “error=A”
Is it possible to create conditions that ask for rating? If yes, could you please provide what should be specified as values for “error” “op” ?
This command produces the following error message:
curl -X POST --insecure -u toooookeeeen: Code Quality and Code Security | SonarQube -d “gateName=theNAME” -d “metric=reliability_rating” -d “op=LT” -d “error=0.5”
error: {“msg”:“Operator LT is not allowed for this metric.”},{“msg”:“Invalid value \u00270.5\u0027 for metric \u0027Reliability Rating\u0027”},{“msg”:“\u00270.5\u0027 is not a valid rating”}
Thanks in advance for your valuable assistance.