# Branch Filters

### Overview

The Branch Filter allows you to scope metric data to specific branches or groups of branches. Administrators can configure named branch patterns (categories) that appear as filter options across the platform. When no patterns are configured, the filter defaults to showing all available branches.

#### Branch Pattern Configuration

Branch patterns are configured by users with Admin (config) permissions in the **Configuration screen -> Branch -> Branch Pattern Categorization**. There is no limit on the number of patterns that can be created.

**Each category entry includes:**

* A category name (e.g., Release, Feature, Hotfix)
* One or more branch patterns (e.g., release/\*, feature/\*)
* Multiple patterns within a single category are combined using an OR condition - a branch matching any of the patterns is included
* All patterns match against the destination branch of a pull request

<div data-with-frame="true"><figure><img src="/files/eW8aeYaL3UOPV17JVPLO" alt=""><figcaption></figcaption></figure></div>

**Pattern Matching Syntax:**

| **Pattern Format** | **Behavior** | **Example**                                          |
| ------------------ | ------------ | ---------------------------------------------------- |
| branch-name        | Exact match  | main matches only the main branch                    |
| \*branch           | Suffix match | \*-hotfix matches any branch ending with -hotfix     |
| branch\*           | Prefix match | release/\* matches any branch starting with release/ |

**Default Behavior (No Patterns Configured):**

When no branch patterns have been configured:

* Pull Request and Process screens: All branches are shown in the branch filter. Users can select branches directly and view data.
* Cockpit page: The branch filter is not displayed. Data is calculated across all branches, as before.

{% hint style="info" %}
**Note:** The absence of a branch filter on the Cockpit does not affect data completeness. All branches are included in Cockpit calculations by default.
{% endhint %}

**Behavior After Patterns Are Configured:**

Once branch patterns are saved, the behavior changes across all pages:

* The branch filter displays the configured pattern categories (not individual branches).
* No pattern is auto-selected by default - unless a default is set in user preferences.
* The filter in each metric has an option to "apply to all applicable metrics" - which applies the current filter to all the applicable metrics in the dashboard.

<div data-with-frame="true"><figure><img src="/files/tpAplHpxOtKbZ1HSxUmO" alt=""><figcaption></figcaption></figure></div>

* When the "apply to all applicable metrics" toggle is unchecked, the filter only applies to the selected metric and not the others in the dashboard.

<div data-with-frame="true"><figure><img src="/files/bwHDGuo7ydAsGTtqMQlL" alt=""><figcaption></figcaption></figure></div>

**Where is the branch filter?**

* Pull Request and Process screens: The Branch filter is **located under Advanced Filters**, along with the Label and Workspace filters.

<div data-with-frame="true"><figure><img src="/files/xPZGO8Tlkq7JaaYgpk1p" alt=""><figcaption></figcaption></figure></div>

* Cockpit: The Branch filter is part of each of the applicable metrics on a particular dashboard.

<div data-with-frame="true"><figure><img src="/files/vsYAULFbPlynU3J8gJod" alt=""><figcaption></figcaption></figure></div>

**Setting a Default Branch Pattern:**

Users can set a default branch pattern via User Profile preferences, similar to how default Team and Board selections work.

When a default branch pattern is set:

* The selected pattern is automatically applied as the branch filter when metric pages load.
* The default can be changed or cleared at any time from User Profile settings.

**Metrics Where the Branch Filter Applies:**

| **Metric**          | **Metric**     |
| ------------------- | -------------- |
| Average Pickup Time | Merge Time     |
| Average PR Size     | PRs > 400 LOC  |
| Coding Time         | PRs Merged     |
| Cycle Time          | PRs Opened     |
| Flashy Reviews      | PRs Reviewed   |
| Review Time         | Unreviewed PRs |

**Metrics Not Affected by the Branch Filter:**

The branch filter does not apply to the following metric categories. Data for these metrics is always calculated across all branches.

* Commit Metrics (Commits opened, LOC metrics, Commit Frequency, etc.)
* Release Metrics (Release Merge Frequency, Hotfix Rate, Hotfix Rework Time)
* DORA Metrics
* Jira Metrics
* Meeting and Active Days Metrics


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hivel.ai/configurations/branch-configurations/branch-filters.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
