# Triage new issues automatically

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/air/llms.txt).

An issue triage automation picks up every new issue, reads it, searches the codebase for the code it's about, and compares it with the other open issues. Then it sets the type and priority labels and adds one comment: why it made that call, and what will help whoever picks the issue up – the relevant files, related issues, and likely root causes.

You build it from the Issue Triage [template](https://www.jetbrains.com/help/air/automation-templates.html.md). It works with GitHub issues, GitLab work items, and Jira issues.

<a id="issue_triage_setup"></a>

## Set up triage

GitHub or GitLab:

<a id="issue_triage_setup_vcs_procedure"></a>

Procedure: Triage new GitHub or GitLab issues

1. On the Automations page, click New Automation. In Instructions, click Use Template and select Issue Triage under By Air.

2. Select the repository the issues belong to.

3. In Triggers, add `GitHub | Issue | Opened`, or `GitLab | Work item | Opened` for a GitLab project, and set the change handling to No code changes.

![An Issue opened trigger set to No code changes](images/automation-example-issue-triage-trigger.png)

4. Tell the agent which labels to use – see [Tell it your labels and priorities](#issue_triage_labels).

5. Click Create.

Jira:

<a id="issue_triage_setup_jira_procedure"></a>

Procedure: Triage new Jira issues

1. Make sure that a Jira administrator has connected your Jira instance – see [Connect Jira](https://www.jetbrains.com/help/air/connect-jira.html.md) – and that you have a Jira [connector](https://www.jetbrains.com/help/air/connectors.html.md). The trigger starts the run, and the connector lets the agent set fields and comment on the issue.

2. On the Automations page, click New Automation. In Instructions, click Use Template and select Issue Triage under By Air.

3. Select the repository with the code the issues are about. If the issues aren't about code, leave the repository empty – see [Work without a repository](https://www.jetbrains.com/help/air/automation-repositories.html.md#no_repo_automation).

4. In Triggers, add `Jira | Issue | Issue created`, enter the project key in in project, and set the change handling to No code changes.

5. In Connectors, add the Jira connector.

6. Tell the agent which fields to set – see [Tell it your labels and priorities](#issue_triage_labels) – and click Create.

<a id="issue_triage_labels"></a>

## Tell it your labels and priorities

Without your scheme, the agent picks labels from those it sees on other issues. Spell the scheme out at the end of the instructions. For example:

```TEXT
Use exactly one type label: bug, feature, or question.
Use exactly one priority label: P1 for data loss, security, or an outage; P2 for a broken feature with no
workaround; P3 for everything else.
Add the area label that matches the top-level folder the issue is about: area/api, area/web, or area/cli.
Don't assign the issue to anyone.
```

<a id="issue_triage_go_further"></a>

## Go further

* Triage one source only – on GitHub, use the Issue author filter on the trigger to triage only the issues from a specific author, such as the bot that files issues from your support desk.

* Fix the bugs it finds – a second automation can take every issue labeled `bug` and open a pull request with the fix – see [Turn bug reports into fix pull requests](https://www.jetbrains.com/help/air/fix-bugs-from-issues.html.md).

* Post each call to Slack – to see what came in without opening every issue, add a webhook [notification](https://www.jetbrains.com/help/air/automation-notifications.html.md) that posts each run's summary to a Slack channel.

