Bitbucket integration with DevOps Change Velocity
Summarize
Summary of Bitbucket integration with DevOps Change Velocity
ServiceNow's DevOps Change Velocity enables integration with Bitbucket Cloud to track repositories, commits, branches, and pull requests. This integration supports the Code (Repository) capability, allowing you to connect and monitor Bitbucket activities directly within the ServiceNow platform.
Show less
Authentication Methods
You can connect to Bitbucket Cloud using one of the following authentication methods, each requiring specific setup steps and permissions:
- Basic Auth: Uses email and API token with defined scopes. This method discovers repositories across all workspaces in the organization. API tokens must include permissions for account, projects, pull requests, repositories, and webhooks.
- OAuth 2.0 - Authorization Code: Requires creating an OAuth consumer in Bitbucket with permissions for account, projects, webhooks, and pull requests. The ServiceNow instance URL must be set as the callback URL. This method also discovers repositories for all workspaces but is limited by Bitbucket.
- OAuth 2.0 - Client Credentials: Similar to Authorization Code but requires the OAuth consumer to be marked as a private consumer in Bitbucket. The client ID and secret from the OAuth consumer are used to create the credential. Callback URL setup is required as well.
- Access Token: Created following Atlassian documentation with required permissions similar to other methods. Workspace ID from Bitbucket is needed for configuration.
Onboarding Bitbucket
ServiceNow offers multiple ways to onboard your Bitbucket instance into DevOps Change Velocity, enabling connection, discovery, and configuration:
- Workspace Experience: Provides a guided interface within DevOps Change Velocity to onboard and configure Bitbucket.
- Service Catalog: Allows onboarding through the ServiceNow Service Catalog interface.
- Classic UI: Supports traditional onboarding via the Classic user interface.
Each onboarding method facilitates a streamlined connection to your Bitbucket instance, enabling comprehensive tracking and management of your DevOps code repositories.
Connect to your Bitbucket instance to track Bitbucket repositories, commits, branches, and pull requests.
Bitbucket integration overview
DevOps Change Velocity supports the Code (Repository) capability for the Bitbucket tool.
Authentication methods
You can connect to Bitbucket Cloud using one of the following authentication methods:
- Basic Auth
- OAuth 2.0 - Authorization Code
- You must create the OAuth consumer in the Bitbucket tool with the required permissions before creating the OAuth record for Authorization Code. You can navigate to Workspace settings > OAuth consumers > Add consumer in Bitbucket to add the OAuth consumer.
Select the following permissions for the OAuth consumer.
- Account: Read
- Projects: Read
- Webhooks: Read and write
- Pull requests: Read
Ensure that the This is a private consumer option isn’t selected. You must enter your ServiceNow instance URL in the Callback URL field in the following format.https://<instanceurl>/oauth_redirect.doYou can create an OAuth 2.0 - Authorization Code credential by performing the steps specified in the Set up OAuth 2.0 Authorization Code for Bitbucket Cloud procedure.
- OAuth 2.0 - Client Credentials
- You must create the OAuth consumer in the Bitbucket tool with the required permissions before creating the OAuth record for Client Credentials. You can navigate to Workspace settings > OAuth consumers > Add consumer in
Bitbucket to add the OAuth consumer.
Select the following permissions for the OAuth consumer.
- Account: Read
- Projects: Read
- Webhooks: Read and write
- Pull requests: Read
Ensure that the This is a private consumer option is selected as well. You must enter your ServiceNow instance URL in the Callback URL field in the following format.You can create an OAuth 2.0 - Client Credential record in the workspace UI while onboarding the tool. You need the Client Id and Client secret values of your Bitbucket workspace. Client ID of your Bitbucket tool is available in the OAuth consumers section of your workspace settings (Workspace settings > OAuth consumers > Add consumer) in the Key field. Client secret of your Bitbucket tool is available in the OAuth consumers section of your workspace settings (Workspace settings > OAuth consumers > Add consumer) in the Secret field.https://<instanceurl>/oauth_redirect.do - Access Token
- You can create the access token by performing the steps specified in the Atlassian documentation. Ensure that the following permissions are provided while creating the access token:
- Account: Read
- Projects: Read
- Webhooks: Read and write
- Pull requests: Read
You also need the workspace ID of your Bitbucket workspace. Copy it from the Workspace ID field in the Workspace settings of your Bitbucket Cloud account.
Get started
Use one of the following options to onboard Bitbucket. For a guided experience, use the workspace to onboard a tool. Alternatively, you can use the Service Catalog or Classic experience.