Bitbucket Cloud Configuration

Bitbucket Cloud Configuration

Creating an API Token in Bitbucket Cloud

Supported Bitbucket Cloud Authentication
For secure authentication with Bitbucket Cloud, use API tokens with scopes. API tokens are the supported authentication method for this integration. For more information, refer to the official Bitbucket Cloud documentation on API tokens.

When configuring this integration, use the user's Atlassian email as the username and the API token as the password. Create the token with the required Bitbucket Cloud scopes to allow the integration to access repositories, pull requests, workspace information, and user information.

Required API Token Scopes

Create an API Token

Follow the steps listed below to create an API token with scopes for automated pull requests and automated commit feedback:

  1. Log into Bitbucket Cloud.
  2. Select your profile avatar and open Account settings.
  3. In the account settings menu, open Security.
  4. In the API tokens section, select Create and manage API tokens.
  5. Click Create API token with scopes.
  6. Enter a label for the token and select an expiration date according to your organization's requirements.
  7. Select Bitbucket as the product, then add the required scopes.
  8. Click Create, then copy and save the API token somewhere safe.

After the token is created, when configuring the Source Control in IQ Server, enter your Bitbucket Cloud login email address as the username and the API token as the password.

See this article for more information on Bitbucket Cloud API tokens.

Protecting the Target Branch

You can prevent users from merging Pull Requests with failing IQ Policy Evaluations two ways in Bitbucket Cloud. IQ Policy Evaluations must be set to Fail at the Source Stage.

  1. For all accounts, users get notified when they don't have that number of successful builds for the most recent commit.
  2. For premium accounts, users won't be able to merge if their pull request has unresolved merge checks.

Click Repository Settings  Workflow  Branch restrictions.

Select the a branch option and desired write and merge access. Select Minimum number of successful builds for the last commit with no failed builds and no in progress builds in the Merge checks section under the Merge settings tab.

This will inform users that the requirements are not fulfilled when trying to merge. It will not prevent the merge.

Premium accounts have the additional ability to prevent the merge.

This will prevent users from merging a pull request with a failed build.

See these pages for more information: