> For the complete documentation index, see [llms.txt](https://knowledgebase.autorabit.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://knowledgebase.autorabit.com/product-guides/integral-zone/iz-suite/workspaces/code-analysis/pull-requests.md).

# Pull Requests

The **Pull requests** tab of Code Analysis lists the pull requests assessed in the last 30 days, with the quality gate of their first and latest assessment and the findings they introduce. Use it to see whether changes pass the gate the first time and which pull requests bring new findings.

Open it from **Workspaces** → **Code Analysis** → **Pull requests** in the sidebar.

{% hint style="info" %}
Requires the **Code Analysis** licence.
{% endhint %}

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FSz8h4cT0K5itRPQw5jqA%2Fv2-code-prs.png?alt=media&amp;token=c40c2801-18e0-4816-8521-5f2c5041a635" alt="Pull requests tab with organization and state filters, three metric tiles and the pull request list"><figcaption><p>Pull requests</p></figcaption></figure>

## Filters

| Filter           | Description                                            |
| ---------------- | ------------------------------------------------------ |
| **Organization** | One organization, or **All authorized organizations**. |
| **State**        | **All pull requests** or **Open only**.                |

Saved filters work as described in Workspaces.

## Metric tiles

| Tile                                     | Description                                                                                                                                                                                        |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **First-time gate pass rate (30 days)**  | The share of gated pull requests whose first assessment passed the gate. Shows **Not measured yet** until enough pull requests are gated; the detail says how many are gated and how many are not. |
| **Median new findings per pull request** | From each pull request's latest assessment, including findings under an exception.                                                                                                                 |
| **Pull requests (30 days)**              | Pull requests assessed in the last 30 days, with the number still open.                                                                                                                            |

## Pull request list

The list shows the most new findings first. Click a pull request to open its dossier.

| Column                             | Description                                                                                             |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------- |
| **Pull request**                   | Number, source branch → target branch, and repository.                                                  |
| **State**                          | The pull request's state, for example **Open** or **Declined**, or **Not recorded**.                    |
| **Quality gate**                   | The gate of the latest assessment.                                                                      |
| **First gate (new code)**          | The gate of the pull request's first assessment, on new code. **Not gated** when no gate was evaluated. |
| **Latest gate (after exceptions)** | The gate of the latest assessment after approved exceptions.                                            |
| **New findings**                   | New, fixed and excepted findings compared with the target branch.                                       |
| **Assessed**                       | When the latest assessment was recorded.                                                                |

Search, **Refresh**, **Columns** and **Export** work as described in Workspaces.

{% hint style="info" %}
As the note under the list says, closed pull requests are kept for 30 days, and a pull request without a gate result never counts as a pass.
{% endhint %}

## Pull request dossier

The dossier of a pull request has the same layout as a [branch dossier](https://knowledgebase.autorabit.com/product-guides/integral-zone/iz-suite/workspaces/code-analysis/branches-and-baselines.md). Its subtitle shows the pull request number, source and target branches, state and commit. The **Posture & evidence** panel compares the pull request with its target branch, and **New code only** in its findings keeps only findings that are not open on the target branch.

## Scan pull requests

Pull requests reach this list in two ways:

| Source                  | How to set it up                                                                                                                                                                                                                                           |
| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Bitbucket webhook**   | In Setup, turn on **Scan pull requests from Bitbucket**, then add the webhook it shows (URL and secret) to each Bitbucket repository, with the pull request created and updated triggers. A pull request is then scanned whenever it is opened or updated. |
| **Your CI/CD pipeline** | Run the CLI with `-pullRequestId` instead of `-scmBranchName`, and pass the branch the pull request merges into with `-pullRequestTargetBranch`.                                                                                                           |

```bash
./iz-scan-cli-$IZ_CLI_VERSION-linux/bin/iz-scan-cli -serviceHost "https://izsuite.example.com" -authToken "$IZ_ACCESS_TOKEN" -applicationKey "orders-eapi" -source . -pullRequestId "$BITBUCKET_PR_ID" -pullRequestTargetBranch "$BITBUCKET_PR_DESTINATION_BRANCH" > iz-scan.log 2>&1 || true
```

See [Branches & Baselines](https://knowledgebase.autorabit.com/product-guides/integral-zone/iz-suite/workspaces/code-analysis/branches-and-baselines.md) for the full pipeline step.

## How a pull request is assessed

The target branch's latest scan is the pull request's baseline.

* **Target branch already scanned**: the pull request is assessed on **new code** only, the findings it adds compared with the target branch.
* **Target branch not scanned yet**: every issue in the pull request is assessed.

{% hint style="success" %}
Scan your main branches first, so pull requests are judged only on the code they change.
{% endhint %}

## Next Steps

* [Branches & Baselines](https://knowledgebase.autorabit.com/product-guides/integral-zone/iz-suite/workspaces/code-analysis/branches-and-baselines.md): open the target branch's dossier.
* [Findings](https://knowledgebase.autorabit.com/product-guides/integral-zone/iz-suite/workspaces/code-analysis/findings.md): investigate the findings a pull request introduced.
* [Manage Scanning](https://knowledgebase.autorabit.com/product-guides/integral-zone/iz-suite/workspaces/code-analysis/manage-scanning.md): turn on pull-request scanning.
* [Code Analysis](https://knowledgebase.autorabit.com/product-guides/integral-zone/iz-suite/workspaces/code-analysis.md): back to the workspace.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://knowledgebase.autorabit.com/product-guides/integral-zone/iz-suite/workspaces/code-analysis/pull-requests.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
