# Test Labels

Test labels are organization-scoped tags you can apply to individual test cases to organize, filter, and categorize your test suite. Labels are applied manually today; see [Automatic labeling from monitors](#automatic-labeling-from-monitors) for what's coming.

<figure><img src="https://577236045-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F61Ep9MrYBkJa0Yq3zS1s%2Fuploads%2Fgit-blob-57c6b51d7823055d0579b30cdeeb7c3a32806a3b%2Ftest-details-labels.png?alt=media" alt="Labels applied to a test on details page"><figcaption></figcaption></figure>

### Manage labels

Labels are created, edited, and deleted at **Settings > Organization > Test Labels**. Each label has a name, an optional description, and a color used for its chip in the UI. The settings page also shows how many test cases each label is currently applied to.

{% hint style="warning" %}
Deleting a label removes it from every test case it's applied to; this cannot be undone.
{% endhint %}

<figure><img src="https://577236045-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F61Ep9MrYBkJa0Yq3zS1s%2Fuploads%2Fgit-blob-6742edcf04a809ae449971e3871b3fb2ff44e2b4%2Ftest-labels-settings.png?alt=media" alt="Settings page to manage test labels"><figcaption></figcaption></figure>

### Apply and remove labels on a test case

You apply and remove labels from a test case using the label picker on the test case detail page. The picker lets you search existing labels, toggle them on or off, and create a new label inline if one doesn't already exist. Each assignment records who applied the label and when.

<figure><img src="https://577236045-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F61Ep9MrYBkJa0Yq3zS1s%2Fuploads%2Fgit-blob-608e5e2712d2ade646da44dc4451eab522127e7e%2Ftest-details-label-picker.png?alt=media" alt="Label picker on test details page"><figcaption></figcaption></figure>

### Filter tests by label

On the tests list, you can filter the table down to test cases that have a particular label applied. This makes labels useful for slicing the view by the categories your team cares about.

<figure><img src="https://577236045-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F61Ep9MrYBkJa0Yq3zS1s%2Fuploads%2Fgit-blob-658ff2c8a278fbeab8ffb66296b8492a66e1dfb9%2Ftests-list-filtered-by-label.png?alt=media" alt="Filter tests to those that have specified label applied"><figcaption></figcaption></figure>

### Automatic labeling from monitors

{% hint style="info" %}
**Coming soon.** Monitors will be able to automatically apply and remove labels on test cases based on test behavior. More details will be published when this is available.
{% endhint %}

### Related

* [Managing detected flaky tests](https://docs.trunk.io/flaky-tests/managing-detected-flaky-tests) — a step-by-step process for handling detected flaky tests
* [Flake Detection](https://docs.trunk.io/flaky-tests/detection) — monitors that classify tests as flaky or broken


---

# 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.trunk.io/flaky-tests/test-labels.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.
