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

# Bitbucket

> Bitbucket helps you host code, review changes, and track work in repositories, branches, pull requests, and issues via your connected account.

Use Bitbucket when your workflow needs repository, branch, pull request, or issue data. It can read and update code review and tracking work in your connected workspace.

## Configuration

| Option | Required | Description |
| - | - | - |
| Name | No | Label for the step in the workflow canvas. |
| Authentication | Yes | The connected Bitbucket account to use for this step. |
| Action | Yes | The Bitbucket action to perform (for example Get repository, List repositories, Create repository, List branches). |
| Arguments | Yes | Per-action form fields generated from the action's schema. Each text field has an **Insert Variable** button for injecting `{{placeholder}}` values. A **Raw JSON** tab is available for advanced usage. |
| When the step fails | No | Controls whether the workflow should **Terminate Workflow** or **Continue** if this step fails. |

Before you configure this step, connect Bitbucket in **Integrations** for your workspace using the sign-in flow. If no active connection is available, the step shows a warning with a link to **Integrations** instead of the account selector.

## Arguments form

When you select an action, the **Arguments** section renders a form driven by the action's input schema. Fields that refer to existing records include dropdown pickers.

Switch to the **Raw JSON** tab when you prefer to write the full arguments object by hand. Changes in either tab stay in sync.

## Common actions

| Action | Description |
| - | - |
| **Get repository** | Retrieve details for a repository in a workspace. |
| **List repositories** | List repositories available in a workspace. |
| **Create repository** | Create a new repository in a workspace. |
| **List branches** | List branches in a repository. |
| **Get branch** | Retrieve details for a specific branch. |
| **Create branch** | Create a new branch from a target commit. |
| **List commits** | List commits in a repository. |
| **Get commit** | Retrieve details for a specific commit. |
| **Get commit diff** | Retrieve the diff for a commit or revision range. |
| **List pull requests** | List pull requests in a repository. |
| **Get pull request** | Retrieve details for a specific pull request. |
| **Create pull request** | Create a pull request from a source branch. |
| **Approve pull request** | Approve a pull request as the current user. |
| **Update pull request** | Update the title, description, or reviewers on a pull request. |
| **List issues** | List issues in a repository. |

Destructive actions, such as deleting records, are not available in the workflow action picker.

## Output

This step stores the Bitbucket response as the step output. The shape of the response depends on the action.

Use the full output reference in later steps:

```text theme={null}
{{STEP_IDENTIFIER.output}}
```

## Example

1. Open **Integrations** and connect Bitbucket if you have not already done that.
2. Add a **Bitbucket** step to your workflow.
3. Select a connected account in **Authentication**.
4. Choose **Get repository** in **Action**.
5. Fill in the required fields. Use **Insert Variable** to reference an earlier step's output for any field value.
6. Click **Run** in the step header to test the action, then review the returned payload in **Output**.

## Use cases

### Open a review from a branch

1. List branches
2. Get branch
3. Create pull request
4. Approve pull request

### Track a new bug

1. List issues
2. Create issue
3. Update issue

### Inspect a code change

1. List commits
2. Get commit
3. Get commit diff
4. Get pull request

## Notes

* This step depends on a connected Bitbucket integration in your workspace.
* The workflow action picker shows a curated set of actions. Agents with the Bitbucket tool can use more of them.
* The sign-in screen may show third-party authorization branding.

## Using Bitbucket as an Agent Tool

You can also add Bitbucket as a tool in the **Agent Editor**. Open the agent, click **Add tool**, and select **Bitbucket**. In the tool settings panel, choose the connected account the agent should use. The agent calls Bitbucket actions when they are relevant to the conversation.

See also: [Integrations](https://docs.fetchhive.com/workspace/integrations.md), [Creating and Editing](https://docs.fetchhive.com/workflows/creating-and-editing.md), and [Testing and Iteration](https://docs.fetchhive.com/workflows/testing-and-iteration.md)


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