# Bitbucket

> Connect Bitbucket so every pull request your team raises reaches Context Management, ready to map to a sprint for test generation.

The Arcus Bitbucket integration sends every pull request your team raises to [QI Home](https://testsigma.com/docs/arcus/v2/qi-home/overview/), where Arcus generates test cases from its code changes.

## Prerequisites

- An active Arcus project.
- Admin access to the Bitbucket workspace.

## Connect Bitbucket

Developers don't change how they work. Once Bitbucket is connected, every pull request reaches Arcus on its own.

1. In the left navigation, go to **Settings > Integrations**, and click **Connect** next to **Bitbucket**.

2. Sign in to Bitbucket if prompted, and select the Bitbucket workspace to connect.

3. Select all repositories, or choose specific repositories.

4. Click **Grant access**. Bitbucket redirects you to Arcus.

5. In the **Connect Bitbucket** dialog, select the **Workspace** and **Project** to link this connection to.

6. Click **Connect**.

Pull requests raised in the connected repositories now arrive on the **Unlinked Contexts** tab of Context Management.

## Map pull requests automatically

With a tracker such as [Jira](https://testsigma.com/docs/arcus/v2/integrations/project-management/jira/) connected, a pull request whose title or description contains a ticket ID such as `PROJ-123` goes straight to the sprint holding that story. It never reaches **Unlinked Contexts**, and nobody maps it manually.

A pull request with no ticket ID lands in **Unlinked Contexts** whether or not a tracker is connected. Map it manually from there.

## Verify the connection

1. In the left navigation, go to **Settings > Integrations**.

2. Under **Bitbucket**, confirm the workspace name and repository list appear with a **Connected** status.

3. Raise a test pull request in one of the connected repositories.

4. Open **QI Home > Context Management**. The pull request appears on the **Unlinked Contexts** tab within a few seconds.

## Map a pull request

On **Unlinked Contexts**, click **Map to Module** on the pull request, then pick a sprint and its stories, or an Adhoc session. Arcus generates test cases from the pull request's changes, and the entry moves to **Linked Contexts**.

The full steps, including mapping several entries at once and discarding one that isn't relevant, are in [Context Management](https://testsigma.com/docs/arcus/v2/qi-home/context-management/#map-a-context).

If the same work was captured by a coding tool plugin, Arcus joins the pull request with that session. Mapping one maps both.
