Bitbucket integration with DevOps Change Velocity
Summarize
Summary of Bitbucket integration with DevOps Change Velocity
ServiceNow DevOps Change Velocity enables integration with Bitbucket to track repositories, commits, branches, and pull requests. This integration supports the Code (Repository) capability for Bitbucket, helping customers streamline their development workflows by connecting their Bitbucket Cloud instances with DevOps Change Velocity.
Show less
Authentication Methods
Customers can connect to Bitbucket Cloud using one of the following authentication methods, each requiring specific configuration steps and permissions:
- Basic Auth: Requires Bitbucket Cloud email and an API token. The token must have scopes for reading account, projects, pull requests, repositories, and managing webhooks. This method discovers repositories across all workspaces in the organization.
- OAuth 2.0 - Authorization Code: Requires creating an OAuth consumer in Bitbucket with permissions to read account, projects, pull requests, and read/write webhooks. The ServiceNow instance URL must be set as the callback URL. This method also discovers repositories for all workspaces but requires that the consumer is not marked as private.
- OAuth 2.0 - Client Credentials: Similar to Authorization Code but designed for server-to-server authentication where the consumer is marked as private. Required permissions are the same, and the ServiceNow instance URL must be the callback URL. Client ID and Client Secret from Bitbucket OAuth consumer are used to create the credential in ServiceNow.
- Access Token: Tokens created following Atlassian’s documentation with necessary scopes for reading account, projects, pull requests, and managing webhooks. Workspace ID from Bitbucket is also needed.
Onboarding Bitbucket Integration
ServiceNow customers can onboard Bitbucket into DevOps Change Velocity through three options depending on their preferences:
- Workspace Experience: A guided, unified UI to create, connect, discover, and configure Bitbucket integration.
- Service Catalog: Onboard and configure Bitbucket integration using the ServiceNow Service Catalog interface.
- Classic UI: Use the traditional interface to connect and configure Bitbucket integration.
Practical Benefits
This integration helps ServiceNow customers monitor and manage Bitbucket repositories and associated development activities directly within DevOps Change Velocity. By leveraging supported authentication methods, customers can securely connect their Bitbucket Cloud environment and gain visibility into their code repositories, pull requests, and development workflows, enhancing traceability and accelerating release velocity.
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
-
When you select the credential type as Basic Auth the repositories for all the workspaces in the organization are discovered. You need the email address and API token with scopes of your Bitbucket Cloud account to connect using Basic Auth. You can copy your email address by navigating to of your Bitbucket Cloud account.
To get the API token with scopes, perform the following steps:- Select your profile avatar at the bottom-left of the Bitbucket sidebar, then select Account settings.
- From the Atlassian Account page, select the Security tab on the top navigation bar.
- Select Create and manage API tokens.
- Select Create API token with scopes.
- Give the API token a name and an expiry date, usually related to the application that will use the token and select Next.
- Select Bitbucket as the app and select Next.
- Select the following scopes (permissions) and select Next.
- read:account — Required to view users profiles.
- read:project:bitbucket — View your projects
- read:pullrequest:bitbucket — View your pull requests
- read:repository:bitbucket — View your repositories
- read:webhook:bitbucket — View your webhooks
- write:webhook:bitbucket — Modify your webhooks
- Review your token and select the Create token button.
- Copy the generated API token and either record or paste it into the application you want to give access.
- 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.