Skip to content

BitBucket Server - Usage

To use the BitBucket Server plug-in, the plug-in must be loaded and an instance created before you can configure the plug-in integration. Configuration properties are defined using the product user interface or a JSON file.

Integration type

The BitBucket Server plug-in supports scheduled events integration which are listed in the following table.

NameDescription
syncBitBucketServerPullRequestsEventQueries the BitBucket Server for pull requests in a project.
syncBitBucketServerCommitsEventQueries the BitBucket Server for commits in a project.

Integration

There are two methods to integrate the plug-in:

  • Using the user interface
  • Using a JSON file

For details, see Using plug-ins in DevOps Velocity.

Using the user interface

  1. From the Plugins page, click Settings > Integrations > Plugins.
  2. Under the Action column for the plug-in, click Add Integration.
  3. On the Add Integration page enter values for the fields used to configure the integration and define communication.
  4. Click Save.

Using a JSON file

The JSON file contains the information for creating a value stream and integrating with the BitBucket server. The following table describes the information for the creating a DevOps Velocity value stream map.

  1. Download the value stream map. The value stream map is a JSON file used to define integrations.
  2. Edit the JSON file to include the plug-in configuration properties.
  3. Save and upload the JSON file. This replaces the current JSON file with the new content.
  4. View the new integration on the Integrations page.

Configuration properties

The following tables describe the properties used to configure the integration. Each table contains the field name when using the user interface and the property name when using a JSON file.

  • The General Configuration Properties table describes configuration properties used by all plug-in integrations.
  • The Bitbucket Configuration Properties table describes the BitBucket configuration properties that define the connection and communications with the BitBucket server. When using the JSON method to integrate the plug-in these properties are coded within the properties configuration property.

General configuration properties

NameDescriptionRequiredProperty Name
NAThe version of the plug-in that you want to use. To view available versions, see the UrbanCodeDockerHub. If a value is not specified, the latest version is used.Noimage
Integration NameAn assigned name to the value stream.Yesname
Logging LevelThe level of Log4j messages to display in the log file. Valid values are: all, debug, info, warn, error, fatal, off, and trace.NologgingLevel
NAList of configuration properties used to connect and communicate with the BitBucket server. Enclose the properties within braces.Yesproperties
NAThe name of the tenant.Yestenant_id
NAUnique identifier assigned to the plug-in. The value for the BitBucket Server plug-in is ucv-ext-bitbucket-serverYestype

Bitbucket properties

NameTypeDescriptionRequiredProperty Name
Access TokenStringThe access token for oauth authentication.Noaccess_token
Access Token SecretSecureThe access token secret for oauth authentication.Noaccess_token_secret
Base API URLStringThe URL to the API.YesbaseApiUrl
Consumer KeyStringThe consumer key for oauth authentication.Noconsumer_key
Consumer SecretSecureThe consumer secret for oauth authentication.Noconsumer_secret
PasswordSecureThe password associated with the user name to authenticate with the BitBucket server.Yespassword
Project KeyStringThe repository project key.YesprojectKey
Project NameStringThe name of the project which contains one or more repositories.YesprojectName
Repository NameArrayAdd list of comma seprated names of the repository.YesrepositoryName
BranchStringThe name of the branch to pull changes from.NobranchName
Signature MethodStringThe name of the signature method for oauth authentication.Nosignature_method
User NameStringThe user name used to authenticate with the Bitbucket server.Nousername
Additional branchesArrayAdditional branches to collect commits from besides the main one, leave blank if not needed. Regular Expression is also enabled(ex-PLUGINS*,*)NootherBranches

JSON code example

The following example can be used as a template to define the integration within the JSON file for a value stream. Copy and paste the template into the JSON file and make the appropriate changes.


{
"type": "ucv-ext-
bitbucket-server",
"tenant_id": "5ade13625558f2c6688d15ce",
"name": "my-bitbucket",
"loggingLevel": "info",
"disabled": false,
"properties": {
    "baseApiUrl": "[Base URL ex: http://10.134.116.110:7990/rest/api/1.0]",
    "username": "admin",
    "password": "[Basic user password]",
    "projectName": "[Full project name ex: JKE Mortgage Application]",
    "projectKey": "[Project key ex:JMA]",
    "repositoryName": "[app repository name ex: web-application]",
    "repositorySlug": "[app repository name ex: web-application]"
    }
}