Skip to main content

Bitbucket integration

Connect Bitbucket so repositories, commits and pull requests feed code-delivery metrics.

The Bitbucket integration pulls repositories, commits, and pull requests into Leanmote. It supports the same DORA and flow metrics as the other source-control integrations.


​

What Leanmote pulls from Bitbucket


​

  • Repositories you select.

  • Commits and authorship.

  • Pull requests with open/merge/close timestamps.

  • Bitbucket Pipelines deployments to your Production environments, when your organization counts DORA from Bitbucket deployments (see below).


​

Note: Bitbucket integration is currently pull-based via the Bitbucket Cloud API. Webhooks are not configured automatically.


​

Connect Bitbucket


​

  1. Open Administration → Integrations.

  2. Find Bitbucket under Source Control and click Connect.

  3. Sign in to your Atlassian / Bitbucket account.

  4. Authorize the requested scopes (listed below).

  5. Select the repositories to track.

  6. Click Save.


​

Sync cadence


​

Because Bitbucket sync is pull-based, expect minute-to-hour latency on new commits and PRs depending on your sync schedule. For higher-fidelity dashboards, prefer GitHub or GitLab where webhooks deliver events in seconds.


​

Deployment data and DORA


​

By default DORA counts merged pull requests as deployments. To have Deployment Frequency, Change Failure Rate and Time to Restore count your Bitbucket Pipelines deployments instead, the organization owner chooses Bitbucket deployments in Settings → Organization Settings → Tabs → Metrics, under Where deployments are counted. Choosing it brings in up to a year of deployment history automatically. If the option says reconnect Bitbucket, reconnect it in Administration → Integrations first: Leanmote needs permission to read your Pipelines.


​

Leanmote reads the deployments Bitbucket Pipelines records for your repositories. A deployment counts when a pipeline step that declares deployment: with an environment of type Production (Repository settings → Deployments) succeeds. There is nothing else to configure.


​

See Deployment Frequency and Change Failure Rate for how each metric counts them.


​

Common issues


​

  • Missing PR review data — confirm reviewers actually opened and approved the PR through Bitbucket; some review tools that overlay Bitbucket aren't captured.

  • Workspaces vs. repositories — Leanmote selects at the repository level. Adding a whole workspace's repos requires multi-select on connect.

  • "Bitbucket is connected, but this account does not see any workspace yet" — the account that connected has no access to a workspace yet: it isn't a member, the workspace admin hasn't approved Leanmote, or the workspace limits access by IP. Ask the workspace admin to give the account access and approve Leanmote and, if access is limited by IP, to allow 100.27.182.179. You don't need to reconnect: once the account has access, the repositories show up in the repository selection and data starts arriving within a few hours.

  • The connection is refused with Bitbucket's answer — the message says which step failed and what Bitbucket answered. A 403 is usually a restriction on your side (the workspace admin, an IP allowlist): ask the admin as above, then connect again. For anything else, try again, and write to us if it keeps failing.


​

Connection details


​

Detail

Value

Connection type

OAuth 2.0 (Leanmote's Bitbucket OAuth consumer)

Who connects in Bitbucket

A member of the workspace: Leanmote reads what that account can see. An account that doesn't see any workspace yet still connects, and starts reading once it has access (see Common issues).

Who can connect in Leanmote

Owner, Manager or Team Leader

Write access

None: every permission on Leanmote's OAuth consumer is read-only.


​

Scopes requested


​

Bitbucket asks you to approve the permissions configured on Leanmote's OAuth consumer:


​

  • Account (read, including email) — your Bitbucket profile, to map identities to Leanmote teammates.

  • Workspace membership (read) — the workspaces you belong to and their members.

  • Projects (read) — the projects that group your repositories.

  • Repositories (read) — repositories and commits.

  • Pull requests (read) — pull requests, their commits, comments and reviews.

  • Pipelines (read) — Bitbucket Pipelines deployments and their environments, used only when your organization counts Bitbucket deployments for Deployment Frequency, Change Failure Rate and Time to Restore.

  • Issues (read) — granted by the consumer; Leanmote does not read Bitbucket issues.


​

No Write or Admin permission is granted.


​

If your security team needs the audit trail, every API call is logged on Bitbucket's side.


​

Related articles


​

  • Integrations overview

  • Connect your first integrations

Did this answer your question?