What I need to know is if there is a way of chosing the projectKey in the moment of the creation of the project.
This project is created in bitbucket pipelines using mvn sonar:sonar with a custom projectKey that does not contain the organization name on it.
If I try to execute the command withouth first creating the project manually in SonarCloud it fails.
It works if I create the project manually and then I update the projectKey manually in SonarCloud to what I want.
It works also if I execute the command locally in my computer and not in the Bitbucket Pipelines environment (it creates the project in SonarCloud correctly with the custom project key)
Is there a way of creating the project with a custom projectKey in the Bitbucket Pipelines environment directly? We are migrating from Sonarqube to SonarCloud and we were doing this automation before.
You would need to make sure that the user running analysis has the Create Projects permission in your organization, but warning () you will not benefit from bound projects, meanign features like Pull Request Decoration won’t work.
So if I create the project manually in the website with the default projectKey and then I update it to my custom value, I won’t lose the benefits of bound projects?
Correct. The project key is just a unique identifier, which is automatically generated because most users are fine with the default value. The binding is something separate, and isn’t lost if you change the project key.