For the complete documentation index, see llms.txt. This page is also available as Markdown.

Importing Bitbucket workspace

This page helps you understand how to import your Bitbucket workspace into SonarQube Cloud and explains prerequisites and key procedures.

When you import a Bitbucket Cloud workspace to SonarQube Cloud, the corresponding Organization is created in SonarQube Cloud and is bound to the DevOps platform organization. Each SonarQube Cloud organization corresponds one-to-one with a Bitbucket Cloud workspace. See Binding with the DevOps platform for more information.

SonarQube Cloud binds to Bitbucket Cloud using the SonarQube Cloud for Bitbucket Cloud app, which you install from your Bitbucket workspace.

The user account you used for the import is automatically assigned to the organization’s owners group which grants you administration rights on the organization. See User group concept for more details.

Prerequisites

You must be an administrator of the Bitbucket workspace:

  • You will already be an administrator of your default workspace.

  • For any other workspace, you have to add your Bitbucket account to a user group with the Administer workspace user right enabled.

  • You have permission to install apps on the Bitbucket workspace you want to bind.

In SonarQube Cloud, each organization is assigned a subscription plan. Before importing your organization, choose the subscription plan suited to your needs, see Subscription plans for more details. In particular, determine the number of Lines of Code (LOC) you need. See LOC-based pricing for more information.

To avoid exceeding Bitbucket Cloud API rate limits, it is recommended to use a dedicated Bitbucket user for SonarQube Cloud integration.

Import procedure

To import a Bitbucket Cloud workspace to SonarQube Cloud, install the SonarQube Cloud for Bitbucket Cloud app on your Bitbucket workspace, then create your organization.

Installing the app

  1. Log in to SonarQube Cloud with your Bitbucket account.

  2. Select the + menu, then select Create new organization.

Creating a new organization in SonarQube Cloud
  1. Under Import from a DevOps platform, select Bitbucket. An onboarding tutorial opens in SonarQube Cloud. Follow the instructions, then select Install application to continue in Atlassian.

  2. In Atlassian, select Get app.

Selecting Get app in Atlassian
  1. Select a site to install the app from the drop-down list.

Selecting a site to install the app in Atlassian
  1. Select Install.

Creating the organization

  1. In Bitbucket, go to your Workspace settings > Forge apps > SonarQube Cloud.

Creating a new organization from Bitbucket workspace settings
  1. Select Create new organization, confirming the redirect to SonarQube Cloud if prompted.

  2. In Import organization details, SonarQube Cloud suggests a Name and Key for your SonarQube Cloud organization. The key is unique across all organizations within SonarQube Cloud. You can accept the suggestion or change it manually. The interface will prevent you from changing it to an already existing key.

  3. The Automatically import new Bitbucket repositories option is selected by default. It imports newly created repositories, but not existing ones, into SonarQube Cloud. Unselect it to turn the feature off. For more information, see Auto-importing new repositories.

  4. Select Add additional info to add:

    • An avatar: a small image representing the organization and displayed on the UI near the organization name.

    • A description of the organization.

    • A URL: the URL of the homepage of the organization displayed on the UI.

  5. Select the subscription plan for your organization. See Subscription plans for more information.

  6. If you selected a paid plan, select the number of Lines of Code (LOC) for your plan and follow the instructions to enter your billing and payment information.

  7. Select Create Organization. The organization is created and opened in SonarQube Cloud.

New organization binding in SonarQube Cloud

Your organization now appears as bound. To verify, go to Administration > Organization settings > Organization binding. In Bitbucket's app settings, you can select Refresh connection status to confirm the binding on Bitbucket's side.

If the import fails because the organization already exists in SonarQube Cloud and you’ve lost administrator access to this organization, send a request to contact@sonarsource.com with all the necessary details.

To bind an existing organization to a Bitbucket workspace instead, see Binding to a Bitbucket Cloud workspace.

Last updated

Was this helpful?