Configure Bitbucket HTTP access tokens
The bitbucket_token variable is required to configure jobs and submit PR comments. Note that repository-level tokens do not behave in the same way as account-level tokens.
| Account-level token | Repository-level token | |
| Configure a job | Required | N/A |
| Submit PR comment |
|
|
Generate an account-level Bitbucket token
Remember to store the token after making it, because Bitbucket will not save the token for you.
- Click your Profile Photo, then Manage Account > HTTP Access Tokens > Create token.
Enter a Token name.
Default settings are fine, or you can change the project and repository permissions, as needed.
- Click the Create button. The token will be generated.
- Store the token.
Generate a repository-level Bitbucket token
Remember to store the token after making it, because Bitbucket will not save the token for you.
- Navigate to your Bitbucket repository.
- Click the Repository Settings icon.
- Click the HTTP access tokens.
- Click the Create token button.
- Enter the token name.
- Click the Create button to make the token.
- Store the token.
Webhook creation and configuration for Bitbucket
For instructions on how to create and configure the webhook for Bitbucket, click here.
Configuring Bitbucket Cloud
To configure a job in Jenkins with Bitbucket Cloud, it is necessary to provide a Bitbucket API token created with scopes having Repositories and Pull Requests Read/Write permissions.
Submitting PR comments in Bitbucket Cloud
The Black Duck Security Scan plugin provides a UI field to configure a Bitbucket Token / username and Password ().
This field provides a global configuration for all pipelines, accepting either secret text or a username with password credential.
Bitbucket Cloud provides several types of access tokens that can be configured using bitbucket_username and/or bitbucket_token parameters.
Bitbucket access token: For using repository, workspace and project access tokens, select the
Secret textcredential option to set the Bitbucket Token. Alternatively, provide a pipeline-specific token by setting thebitbucket_tokenparameter directly in the Jenkinsfile.- Bitbucket API token: Select the
Username with passwordcredential option. Set the username as the Bitbucket email and the password as the Bitbucket API Token. Alternatively, to provide a pipeline-specific Bitbucket API Token, set thebitbucket_usernameandbitbucket_tokenparameters in the Jenkinsfile.Important: Thebitbucket_usernameparameter must be set to the Bitbucket email address when using a Bitbucket API Token.Supported Bitbucket authentications
Access token Recommended use Repository access token - Access required to a single repository
- Use
bitbucket_tokento set Repository Access Token
Project access token (Bitbucket premium) Access required to all repositories within a project
Use
bitbucket_tokento set Project Access Token
Workspace access token (Bitbucket premium) Access required to all projects and repositories in a workspace
Use
bitbucket_tokento set Workspace Access Token
API Token (Recommended) Requires
bitbucket_usernameset to Bitbucket email addressUse
bitbucket_tokento set Bitbucket API TokenRecommended for new integrations
App Password (Deprecated) Requires
bitbucket_usernameset to Bitbucket usernameSwitch to API tokens before June 9th, 2026
App Password deprecation timeline
- New Bitbucket app passwords cannot be created after September 9th, 2025.
- Existing app passwords will continue to work until June 9th, 2026.
- All integrations must switch to API tokens before June 9th, 2026 to avoid disruption.