- Error observed
{
"errors": [
{
"msg": "Setting 'sonar.autoscan.enabled' cannot be set on a Project"
}
]
}
-
Steps to reproduce
Perform a POST call tohttps://sonarcloud.io/api/settings/set?component=my-project-key&key=sonar.autoscan.enabled&value=false
wheremy-project-key
is an existing project. -
Potential workaround
I did find an endpointapi/autoscan/activation
that is called from the frontend that allows you to successfully set this setting, which will work for my use case, but I have reservations about using an endpoint that as far as I can tell is undocumented.
This does not appear to be a permissions issue as I’ve verified I can set other settings via the API, and have tried across both my personal user and the service account we’re using for this automation. Thanks in advance for any help on this.