How to change Bitbucket user upon project creation

Hi all,
I am new in Sonarqube and i need help for changing the bitbucket user upon creation of a new project connected to Bitbucket.
I have logged in to sonarqube as admin. The Bitbucket credentials & authentication were already stored (General Settings → DevOps Platform Integrations). When i tried to create a new project with Bitbucket, i was asked for Bitbucket user credentials, so i provide the credentials of a user. I was able to connect and a page with all the available bitbucket repositories shown. The problem is that the repository i want is not connected to this user. But now when i try to create a new project with Bitbucket, sonarqube always gets the previous provided user by default and the same page bitbucket repositories is shown. How can i change/connect to bitbucket with another user?
Any help is more than welcome, thanks!


  • Sonarqube is deployed in docker container

Believe it or not, this isn’t possible from the UI.

If you can’t revoke the existing token (because it’s used somewhere else), you can send a POST request to SonarQube like this

curl username:password -X POST http://localhost:9000/api/alm_integrations/set_pat?almSetting=<ALM_SETTING_KEY>&pat=test&username=test

the values of pat and username aren’t relevant, you just need to make sure the almSetting is set to the same configuration name you have under General Settings → DevOps Platform Integrations.

Once this is done, you will be able to re-enter your token.

:warning: Make sure you upgrade to SonarQube v9.9 LTS soon, not only to benefit from our Best LTS Ever™, but because soon we will systematically ask users to upgrade when they ask questions about earlier versions of SonarQube, which are now considered unsupported. :smiley: