Hey there April.
taskId
can be missing from a Webhook call when the webhook is triggered by the manual change of an issue status (marking an issue as false-postive, for example) that causes the Quality Gate to change. Here’s an example on my local 2025.1 LTA instance:
{
"serverUrl": "http://localhost:9000",
"status": "SUCCESS",
"analysedAt": "2025-02-10T10:51:17+0100",
"revision": "c8e602a6c822d8bd2fbec3f622303836d5631879",
"changedAt": "2025-02-13T09:55:38+0100",
"project": {
"key": "aws",
"name": "aws",
"url": "http://localhost:9000/dashboard?id=aws"
},
"branch": {
"name": "main",
"type": "BRANCH",
"isMain": true,
"url": "http://localhost:9000/dashboard?id=aws"
},
"qualityGate": {
"name": "Sonar way",
"status": "OK",
"conditions": [
{
"metric": "new_coverage",
"operator": "LESS_THAN",
"value": "0.0",
"status": "OK",
"errorThreshold": "80"
},
{
"metric": "new_duplicated_lines_density",
"operator": "GREATER_THAN",
"value": "0.0",
"status": "OK",
"errorThreshold": "3"
},
{
"metric": "new_security_hotspots_reviewed",
"operator": "LESS_THAN",
"status": "OK",
"errorThreshold": "100"
},
{
"metric": "new_violations",
"operator": "GREATER_THAN",
"value": "0",
"status": "OK",
"errorThreshold": "0"
}
]
},
"properties": {
"sonar.analysis.detectedci": "undetected",
"sonar.analysis.detectedscm": "git"
}
}
This is true for all versions of SonarQube since v7.0 (SONAR-10247)
I was surprised to see that this case isn’t mentioned at all in the documentation on Webhooks! I guess we planned to with SONAR-10251? It was a long time ago, but anyways I’ll ping our docs team to make sure this gets documented.
I can’t figure out a situation where qualityGate
would be blank. I’d encourage you to find out more about the instances of SonarQube exhibiting this behavior (what version are they using?) and provide an example payload that’s missing this data. Maybe there are some other clues!
As far as I’m aware there have been no breaking changes to the webhook payload since it was first developed.