Search code examples
templatessonarqubesonarqube-web

How to apply project template to existing projects in SonarQube


I have several existing projects in my SonarQube and I am trying to sort them to more permission groups that just one (which is current setup).

However, when I create new project template even with very specific key, this template is applied to all the projects if I click "Bulk Apply Template"

Example

Project name: MyAdmin

Project key: cz.mycompany.console:MyAdmin

Project Template name: MyAdmin

Project Key Pattern: cz\.mycompany\.console\:MyAdmin

The above should obviously match only one project. And still, when I click "Bulk Apply Template" the above template is also assigned to all other projects (which have different names).

I am clueless now what am I doing wrong. What should I change to make template match only specific projects?


Solution

  • The project key pattern is used to assign new projects as they're created. When you do a bulk apply you're getting exactly the result you're asking for: apply this template to the current selection of projects.

    Instead, try using the search feature at the top of the project page (note that this searches against project name, not key) to narrow the current list of project, and then use bulk apply.