- Version of SonarQube Server: 10.8.1.101195
- SonarQube deployed: Docker
- what are you trying to achieve:
I’ve been trying to apply bulk permission template via API since we have a lot of projects and I’m also trying to make sure this effort is reusable.
I’m encountering this error for a while now with my script:
{“errors”:[{“msg”:“Template name or template id must be provided, not both.”}]}
I tried a couple of combination of TemplateId, template and templateName on the command and every possible combination of formatting for comma delimited list but to no avail.
I might be doing something wrong here, so help is appreciated!
Here’s what I’m trying to make work:
curl -X POST “https://test-sonarqube.com/api/permissions/bulk_apply_template”
-u “<token123!>”
-H “Content-Type: application/json”
-d ‘{
“templateName”: “sample-template”,
“projects”: [“project1”, “project2”]
}’