Create Bitbucket plugin procedures

3 minute readExtensibilityDeveloper productivity

Plugin procedures can be used in procedure steps, process steps, and pipeline tasks, allowing you to orchestrate third-party tools at the appropriate time in your component, application process, or pipeline.

Depending on your plugin configuration and how you run procedures, the Input parameters  Configuration name field may behave differently in the CloudBees CD/RO UI. For more information, refer to Differences in plugin UI behavior.

Approve pull request

Approves a pull request with the credentials of the service account configured for the plugin.

Input parameters

Table 1. Approve pull request input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Workspace

Required. This can either be the workspace ID (slug) or the workspace UUID, surrounded by curly braces. For example, \{workspace UUID}.

Repository slug

Required. This can either be the repository slug or the UUID of the repository, surrounded by curly braces. For example, \{repository UUID}.

Pull request ID

Required. The pull request ID number.

Create pull request

Creates a pull request.

Input parameters

Table 2. Create pull request input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Workspace

Required. This can either be the workspace ID (slug) or the workspace UUID, surrounded by curly braces. For example, \{workspace UUID}.

Repository slug

Required. This can either be the repository slug or the UUID of the repository, surrounded by curly braces. For example, \{repository UUID}.

Source

Required. The source branch name. For example, my-feature-branch.

Destination

The destination branch name. The default is repository.mainbranch.

Title

The pull request title.

Description

The description for the pull request.

Reviewers

The UUIDs of the reviewers, separated by a newline, or the usernames of the reviewers. If a username is provided, the user must exist in the workspace.

Close source branch

Specifies if the source branch should be closed when merged.

Output parameters

Table 3. Create pull request output parameters
Parameter Description

id

Pull request ID

link

Link to the created pull request

Merge pull request

Merge a pull request using the service account credentials configured for the plugin.

Input parameters

Table 4. Merge pull request input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Workspace

Required. Provide either the workspace ID (slug) or the workspace UUID surrounded by curly braces. Workspace UUID example, \{workspace UUID}.

Repository slug

Required. Provide either the repository slug or the UUID of the repository surrounded by curly braces. Repository UUID example, \{repository UUID}.

Pull request ID

Required. Enter the pull request ID number to merge.

Merge strategy

Select the merge strategy for merging the pull request. Default is Merge commit.

Delete source branch

If selected, the source branch is deleted after merging.

Message

Enter a commit message for the merge commit.

Post commit status

Posts a status of the build associated with the commit.

Input parameters

Table 5. Post commit status input parameters
Parameter Description

Configuration name

Required. The previously defined configuration for the plugin.

Workspace

Required. This can either be the workspace ID (slug) or the workspace UUID surrounded by curly braces. For example, \{workspace UUID}.

Repository slug

Required. This can either be the repository slug or the UUID of the repository, surrounded by curly braces. For example, \{repository UUID}.

Commit ID

Required. The ID (SHA1) of the commit to post the status to. For example, bdfd735733a798823193e5997576b50aba1033e6.

Key

An identifier for the status that is unique to its type. The default is TEST.

URL

A URL that links to the vendor or build system for providing more information about the process that produced the post commit status. This field accepts a context variables repository and a commit that Bitbucket evaluates at runtime. For example, if you use https://foo.com/builds/{repository.full_name}, Bitbucket converts it to https://foo.com/builds/foo/bar at runtime.

Description

A description of the build. For example, "Unit tests in CloudBees CD/RO".

Mimic runtime status

If selected, the Bitbucket status is posted according to the status of the current CloudBees CD/RO runtime.

Status

Provides an indication of the status of the commit.