Integrations / Engineering

Bitbucket

Look up pull requests, pipelines and build statuses, comment on and approve pull requests, and trigger workflows from Bitbucket repository events.

8 tools 17 trigger events

Tools

bitbucket.list_pull_requests

List a repository's pull requests, most recently updated first.

workspace*repo_slug*statepagelen

bitbucket.get_pull_request

Get a pull request by its number, with its reviewers and their approvals.

workspace*repo_slug*pull_request_id*

bitbucket.list_pipelines

List a repository's Bitbucket Pipelines runs, newest first.

workspace*repo_slug*branchstatuspagelen

bitbucket.list_commit_statuses

List the build statuses reported on a commit, from Pipelines and other CI tools.

workspace*repo_slug*commit*

bitbucket.comment_on_pull_request writes

Add a comment to a pull request.

workspace*repo_slug*pull_request_id*body*

bitbucket.approve_pull_request writes

Approve a pull request as the connected user.

workspace*repo_slug*pull_request_id*

bitbucket.api_get

Send a GET request to any Bitbucket API path under https://api.bitbucket.org/2.0 and return the response. For endpoints the named tools don't cover.

path*params

bitbucket.api_request writes

Send a POST, PUT, PATCH or DELETE request to any Bitbucket API path under https://api.bitbucket.org/2.0.

method*path*paramsbody

Tick Allow raw writes on the connection to add api_request, which can send POST, PUT, PATCH and DELETE requests to any Bitbucket API path.

Connect

  1. In Bitbucket Cloud, select your profile icon → Account settings → Security → Create and manage API tokens, and choose Create API token with scopes.
  2. Pick Bitbucket as the app and grant read:user:bitbucket, read:repository:bitbucket, read:pullrequest:bitbucket and read:pipeline:bitbucket, plus write:pullrequest:bitbucket if workflows comment on or approve pull requests.
  3. Paste your Atlassian account email and the API token on the connection.
  4. To trigger workflows, open the repository, select More actions (…) → Settings → Webhooks, add a webhook with the request URL shown on the connection page, set or generate a secret, choose the triggers, and paste the same secret on the connection.

Credentials

Atlassian account email API token Webhook secret

Bitbucket API docs

Triggers

In Bitbucket, open the repository, select More actions (…) → Settings → Webhooks, add a webhook with this URL, set or generate a secret, choose the triggers, and paste the same secret on this connection.

Events

repo:pushrepo:forkrepo:commit_comment_createdrepo:commit_status_createdrepo:commit_status_updatedpullrequest:createdpullrequest:updatedpullrequest:approvedpullrequest:unapprovedpullrequest:changes_request_createdpullrequest:fulfilledpullrequest:rejectedpullrequest:comment_createdpullrequest:comment_resolvedissue:createdissue:updatedissue:comment_created
trigger
kind: bitbucket connection: bitbucket events: [repo:push] repositories: [...]

Your next automation is one sentence away.

14-day free trial with $5 of built-in AI included. Cancel anytime.