> ## Documentation Index
> Fetch the complete documentation index at: https://docs.weaveos.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bitbucket

> Connect your Bitbucket repositories to Weave

Connect Bitbucket to sync your pull requests, commits, code reviews, and team structure from both Bitbucket Cloud and Bitbucket Data Center (self-hosted).

## What's synced

* Pull requests and their metadata
* Commits and code changes
* Code reviews and comments
* Team members and workspace structure
* Repository information
* Pipeline and deployment data (Bitbucket Pipelines)

## Connecting Bitbucket Cloud

<Steps>
  <Step title="Start connection">
    Go to **Data** and click **Connect** on Bitbucket
  </Step>

  <Step title="Authorize Weave">
    Sign in to Bitbucket and authorize the Weave app
  </Step>

  <Step title="Select repositories">
    Choose which repositories to sync from your workspaces
  </Step>

  <Step title="Wait for sync">
    Initial sync may take several minutes depending on repository size
  </Step>
</Steps>

## Permissions required

Weave requests the following Bitbucket permissions:

* **Repository** — Read access to repositories, pull requests, and commits
* **Account** — Read access to your account information and email
* **Workspace** — Read access to workspace members and teams

<Warning>
  For Bitbucket Cloud, Weave only requests read permissions. For Bitbucket Data Center, Weave also requires Projects: Admin access to fetch workspace members. We never modify your code.
</Warning>

## Multiple workspaces

You can connect multiple Bitbucket workspaces. Each workspace's data will be synced separately.

### Choosing the account to connect

Weave connects to Bitbucket Cloud through one Bitbucket account per Weave organization, and lists repositories from every workspace that account can access.

* The account doesn't need to be a workspace admin. It needs to be a member of each workspace you want to sync, with at least read access to the repositories you want to sync.
* To sync repositories from several workspaces, connect an account that belongs to all of them. Many teams use a shared service account so the connection doesn't depend on one person.
* Reconnecting Bitbucket with a different account replaces the existing connection. Before you switch, make sure the new account can access every repository you already sync.

## Sync frequency

Weave syncs Bitbucket data via polling every 3 hours.

## Bitbucket Data Center (self-hosted)

To set up a self-hosted Bitbucket Data Center instance, you need to create an Application Link in Bitbucket. This allows Weave to authenticate with your instance and access your repositories.

### Setup steps

<Steps>
  <Step title="Log in as administrator">
    Log in to your Bitbucket Data Center instance as an administrator
  </Step>

  <Step title="Navigate to Application Links">
    Go to **Administration** → **Application Links**
  </Step>

  <Step title="Create link">
    Select **Create link** and choose **External application** with direction **Incoming**
  </Step>

  <Step title="Configure application">
    Fill in the following details:

    * **Name**: Weave
    * **Redirect URL**: `https://app.workweave.ai/api/bitbucket/oauth/callback`
    * **Permissions**:
      * **Projects**: Admin
      * **Repositories**: Read
  </Step>

  <Step title="Save and copy credentials">
    Select **Save** and copy the **Client ID** and **Client secret**
  </Step>

  <Step title="Connect in Weave">
    Go to the [Weave data sources page](https://app.workweave.ai/data)
    On the Bitbucket card, click **Connect self-hosted**
    Enter your instance URL, Client ID, and Client secret
  </Step>

  <Step title="Select repositories">
    Choose which Bitbucket projects and repositories to sync
  </Step>
</Steps>

### Permissions required

Weave requires the following permissions for Bitbucket Data Center:

* **Projects: Admin** — Required to fetch workspace members and list projects
* **Repositories: Read** — Read access to repository data (commits, PRs, etc.)

### Network configuration

If your Bitbucket Data Center instance is behind a firewall, you may need to allowlist Weave's IP addresses. See the [reference page](/data-sources/reference) for a list of IP addresses to allowlist.

### Automatic repository sync

When you select all available repositories during setup, Weave automatically enables auto-sync for new repositories. This means any new repositories created on your Bitbucket instance will be automatically added to Weave without manual intervention.

If you manually remove individual repositories after the initial setup, auto-sync is disabled. To re-enable it, select all available repositories again.

### Version requirements

<Note>
  Bitbucket Data Center requires version 7.0 or later for full feature support. Weave needs network access to your Bitbucket instance.
</Note>

### Cloud vs Data Center differences

Unlike Bitbucket Cloud, which uses a centralized OAuth application registry, Bitbucket Data Center requires you to manually create an Application Link on your specific instance. This is why you must provide the Client ID and Secret generated by your instance rather than clicking a "Connect" button.

## Supported features

### Code review metrics

* Pull request cycle time and velocity
* Code review turnaround and quality
* Comment analysis and resolution tracking
* Review depth and thoroughness

### Code quality tracking

* Lines of code and code output
* Code turnover and churn analysis
* Bug and revert tracking
* AI-assisted code detection (via Bitbucket Pipelines)

### CI/CD metrics

* Bitbucket Pipelines success rates and frequency
* Deployment tracking (if using Bitbucket Deployments)
* Build and test performance

### Team collaboration

* Engineer activity and contributions
* Team structure from Bitbucket workspaces and groups
* Review participation and patterns

## Bitbucket vs. GitHub terminology

| Bitbucket | GitHub | Description |
| - | - | - |
| Workspace | Organization | Top-level container for repositories |
| Repository | Repository | Code repository |
| Pull Request | Pull Request | Proposed code changes |
| Build | Workflow/Action | CI/CD pipeline execution |

## Troubleshooting

<AccordionGroup>
  <Accordion icon="lock" title="Authorization failed">
    If authorization fails:

    1. Ensure you have read access to the Bitbucket workspace
    2. Check that your Bitbucket account has access to the repositories
    3. Verify your workspace allows third-party OAuth applications
    4. Try disconnecting and reconnecting the integration
  </Accordion>

  <Accordion icon="clock" title="Sync is slow or incomplete">
    If data isn't syncing properly:

    1. Check that repositories are not archived
    2. Verify webhook configuration in repository settings
    3. Ensure your Bitbucket plan includes API access
    4. Contact support if sync is stuck for more than 30 minutes
  </Accordion>

  <Accordion icon="user-slash" title="Missing team members">
    If team members aren't appearing:

    1. Ensure members have commits or pull requests in connected repos
    2. Verify members have public email addresses or linked Weave accounts
    3. Check that members have not been removed from the workspace
    4. Re-sync the integration to refresh team member data
  </Accordion>

  <Accordion icon="server" title="Bitbucket Data Center issues">
    For self-hosted Bitbucket instances:

    1. Ensure Weave can reach your Bitbucket instance (check firewall rules)
    2. Verify the Application Link is configured correctly
    3. Check that API rate limits are not being hit
    4. Review Bitbucket logs for authentication or permission errors
  </Accordion>
</AccordionGroup>

## Data privacy

Weave syncs only metadata about your pull requests, commits, and reviews. We do not store your source code or repository contents.

## Related integrations

* **[GitHub](/code-platforms/github)** — Alternative Git platform
* **[GitLab](/code-platforms/gitlab)** — Alternative Git platform
* **[Jira](/project-management/jira)** — Often used with Bitbucket for issue tracking
* **[Confluence](/documentation/confluence)** — Often used with Bitbucket for documentation


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.