// Bitbucket branch and PR
/d:sonar.pullrequest.branch=“mybranch”
/d:sonar.pullrequest.key=“myPRkey”
// PR decorator. So sonarqube can post build status to the PR in bitbucket
/d:sonar.pullrequest.provider=bitbucketcloud
/d:sonar.pullrequest.bitbucketcloud.repository=repo-UUID
/d:sonar.pullrequest.bitbucketcloud.owner=UUID
When i look at SonarCloud setting it says “To display the quality of your repository, you have to link it with a project analyzed on SonarCloud.”
For now it is not possible to script the link between a BitBucketCloud repo and a SonarCloud project.
We would like to provide the ability to onboard on SonarCloud via an API, but it will not be available in the short term.
Hi. Has there been any development on this front? Is there now a bitbucket/sonarcloud API endpoint for linking bitbucket projects to their corresponding sonarcloud projects?
Hi, @Colin and thanks for the super quick response.
Does that mean that if I use the SonarCloud API to create a project in SonarCloud, the SonarCloud app/plugin in BitBucket will auto-detect and bind to it?
Also, is there a way to programmatically click that button “Show repository overview widget” in BitBucket?
Unfortunately, there aren’t any Public APIs to accomplish either. Provisioning projects through the UI will bind the project (but not click the widget button).
If you’re looking for something “unofficial” you can probably open your browser’s dev tools and see what API calls are being made when doing either action (provisioning the project, binding an existing project, checking the box). But use that knowledge at their own risk because internal APIs are… just that, and the contract might change at any time.
Obviously take the consideration mentioned above that it is not supported.
Would be good to see it added to the supported API though since we require this functionality to automate the onboarding of projects. Doing that manually through the UI with the number of projects we have to onboard is just too painful and time consuming.