> For the complete documentation index, see [llms.txt](https://docs.does.qa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.does.qa/platform/integrations/bitbucket.md).

# Bitbucket

Connect Bitbucket Pipelines to DoesQA so every push and pull request can start a Run as part of the same pipeline that builds your app. Bitbucket calls the [Universal Webhook](/platform/integrations/universal-webhook.md) with a short `curl` step.

## Why use it

* Keep end-to-end coverage next to the code that changed.
* Reuse the same CI/CD key, tags, and Recipes you already use elsewhere.
* Preview Flow selection with GET before you wire the pipeline for real.

## Before you start

1. Create an Active CI/CD webhook key under **Settings → CI/CD**. See [CI / CD](/configuration/ci-cd.md).
2. Copy your **Account ID** from Account Settings.
3. Add repository variables in Bitbucket, for example `DOESQA_KEY` and `DOESQA_ACCOUNT_ID`. Mark the key as secured.

## Add a pipeline step

In `bitbucket-pipelines.yml`:

```yaml
pipelines:
  default:
    - step:
        name: DoesQA Run
        script:
          - |
            curl -sS -X POST \
              "https://app.does.qa/api/hook/${DOESQA_ACCOUNT_ID}?key=${DOESQA_KEY}&withAll=smoke&label=bitbucket-${BITBUCKET_BUILD_NUMBER}&mode=wait"
```

{% hint style="info" %}
**Pro tip:** Start with `mode=wait` so the pipeline step stays green or red with the Run. Use the default fast mode when you only need to fire the Run and move on.
{% endhint %}

### Select Flows and Values

Append the same query options as the [Universal Webhook](/platform/integrations/universal-webhook.md): `withAll`, `withoutAny`, `recipe`, `ids`, `testsTagged`, and URL-encoded `values`.

Example with a staging URL Value:

```yaml
script:
  - |
    VALUES=$(python3 -c 'import urllib.parse; print(urllib.parse.quote("{\"BASE_URL\":\"https://staging.example.com\"}"))')
    curl -sS -X POST \
      "https://app.does.qa/api/hook/${DOESQA_ACCOUNT_ID}?key=${DOESQA_KEY}&withAll=staging&label=bitbucket-${BITBUCKET_BUILD_NUMBER}&values=${VALUES}&mode=wait"
```

## Related

* [Integrations](/platform/integrations.md)
* [Universal Webhook](/platform/integrations/universal-webhook.md)
* [GitHub](/platform/integrations/github.md)
* [GitLab](/platform/integrations/gitlab.md)
* [Azure DevOps](/platform/integrations/azure-devops.md)
* [CI / CD](/configuration/ci-cd.md)
* [Notifications](/configuration/notifications.md)
