Bitbucket Cloud Connection
The Bitbucket Cloud connection integrates your Bitbucket workspace with OpsTower, giving agents the ability to browse repositories, read source files, search code, inspect commits and diffs, review pull requests, and monitor pipeline (CI/CD) status. This mirrors the GitHub integration with Bitbucket-specific features like PR tracking and pipeline monitoring.
Prerequisites
Section titled “Prerequisites”You need a Bitbucket Cloud account. The connection uses OAuth 2.0, so you authorize OpsTower to access your workspace directly from the UI. Code search requires a Bitbucket Standard or Premium plan.
Setup in OpsTower
Section titled “Setup in OpsTower”- Go to Connections > Code > Add Connection.
- Select Bitbucket.
- Click Connect to Bitbucket.
- A popup opens to Bitbucket’s authorization page. Sign in and grant access.
- OpsTower automatically discovers your workspace and stores the connection.
- Optionally configure:
- Default Branch — the default branch for browsing and commits (default:
main) - Restrict to Repository — limit agents to a single repo (format:
workspace/repo-slug)
- Default Branch — the default branch for browsing and commits (default:
What Agents Can Do
Section titled “What Agents Can Do”Once connected, agents have access to eight tools:
- List Repositories — discover all repos in the connected workspace with language, visibility, and default branch
- Browse Repository — explore directory structure at any path and branch
- Read File — read file contents with line numbers, line range filtering, and binary detection (100KB limit)
- Search Code — search for code patterns across the workspace or a specific repo (requires Standard/Premium plan)
- List Commits — view recent commits with author, date, and message, filtered by branch or path
- Get Commit — inspect a specific commit’s details with parallel diffstat showing changed files and line counts
- List Pull Requests — browse PRs by state (OPEN, MERGED, DECLINED, SUPERSEDED) with author, reviewers, and comment counts
- List Pipelines — monitor CI/CD pipeline runs with status, branch, duration, and trigger info
Use Cases
Section titled “Use Cases”- “Show me the most recent commits to the payments service”
- “Find all usages of the
chargeCustomerfunction across our workspace” - “What pull requests are currently open and waiting for review?”
- “Read the
src/services/billing.tsfile in our API repo” - “What pipeline runs failed on the main branch today?”
- “What changed in commit abc1234?”
Troubleshooting
Section titled “Troubleshooting”- OAuth popup blocked — allow popups for the OpsTower domain and try again
- Code search returns 403 — code search requires a Bitbucket Standard or Premium workspace plan
- Pipelines not found (404) — pipelines are not enabled for the repository, or the pipeline OAuth scope was not granted during connection
- Token expired — click “Reconnect to Bitbucket” to refresh the OAuth tokens
- Cross-workspace access — Bitbucket scopes API access to the connected user’s workspace; agents can access any repo the user has permission to within that workspace