which versions are you using - Sonarqube Enterprise edition 9.4
Is referencing a branch from SonarQube UI available globally ? I know we have a parameter sonar.newCode.referenceBranch that can be used in our pipelines to override default project settings, in our organization we want to have main branch as the reference branch for all the projects but there are few projects that use master or develop as their main branch. is there a parameter that can be added in the sonar.project.properties file that would consider the projects main branch as the reference branch instead of having to specify the branch name(master/develop) ?
There’s no global setting that exists to set a specific reference branch as the default, but at a project-level you can set the reference branch to, by default, by a specific branch (in the project-level Administration > New Code)
Using the POST api/new_code_periods/set Web API should help you. You can find a link to the Web API documentation for your SonarQube instance in the footer of your instance, and you might also find this guide helpful:
I’d also invite you to raise a thread in our “Product Manager for a Day” category, or I can just move this thread there if you’d like.