After upgrade Sonar from 9.9 to 10.6, I’ve noticed that I’m not able to set tags via API through the endpoint api/project_tags/set, I’ve been doing this since Aug/2023, and it’s working properly with the body:
{
"project": $projectKey,
"tags": $tag
}
but after the upgrade that’s the output of the response:
{
"errors": [
{
"msg": "The 'project' parameter is missing"
}
]
}
I’ve tested both variables $projectKey and $tag, and it’s all good, I can confirm that both values are ok.
Do you guys have any clue of what might going wrong?
For the record, my sonar instance is on-prem, I’ven executing the tagging script via Azure DevOps Pipeline with poweshell.
I actually can’t get this to work on SonarQube v9.9 either. Can you give more details about how you generate the Web API call (specific commands, etc. would be great)
When I pass form-data it all works as expected. When I pass a raw JSON object, it doesn’t.
I used your script and had no problem against my SonarQube v10.6 instance.
Are you sure that, for example, $(SonarqubeprojectKey) is still resolving correctly? I get the same "The 'project' parameter is missing" message when the value is null as when it’s not included at all.
For example, when I add Write-Host $body, the console prints…
I went through the release update and saw that sonar.login/sonar.password were deprecated, and just replace sonar.login by sonar.token and works like a charm.