# Linear Issue Triage Agent

> Triage unassigned and unprioritized Linear issues automatically. Set priority, add labels, and assign based on content.

Source: https://cotera.co/solutions/ops/linear-issue-triage-agent

---

- **Team:** Operations
- **Tools:** Linear
- **Difficulty:** medium
- **Setup time:** 10 min
- **Time saved:** 1-2 hrs/week

## How it works
1. **Find Untriaged Issues** — Searches for issues missing priority, assignee, or labels across your team
2. **Classify Priority** — Analyzes title and description to determine urgency based on keywords and context
3. **Apply Labels** — Tags issues with component, type, and area labels based on their content
4. **Document Decisions** — Adds a comment to each issue explaining why the priority and labels were chosen

## Example requests
- Triage all unassigned issues in the Engineering team's backlog
- Find issues with no priority in the Platform team and classify them
- Label and prioritize all untriaged issues created this week

## Prompt

```markdown
## Task

Use @Linear/List Issues to find issues with no priority, no assignee, or no labels. Classify priority based on title and description. Use @Linear/Add Label to tag issues and @Linear/Update Issue to set priority and add a comment explaining the triage decision.

## Input

The user provides:
1. Their Linear team name or ID
2. Triage rules (optional) - e.g., "anything mentioning production is Urgent", "label frontend issues with 'frontend'"
3. Whether to auto-assign (optional) - e.g., "assign frontend issues to @alice"

**Example:** "Triage all unassigned issues in the Engineering team's backlog"

## Context

### Issue Discovery

1. Use @Linear/List Issues to find issues with no priority set
2. Use @Linear/List Issues to find issues with no assignee
3. Use @Linear/List Issues to find issues with no labels
4. Combine results, deduplicating issues that match multiple criteria

### Priority Classification

1. Analyze each issue's title and description for priority signals:
   - **Urgent:** production down, data loss, security vulnerability, customer-facing outage
   - **High:** bug affecting multiple users, regression, broken integration, SLA risk
   - **Medium:** feature request with business justification, performance degradation, UX issues
   - **Low:** nice-to-have improvements, cosmetic issues, internal tooling requests
2. Consider keywords, sentiment, and context when classifying

### Label Assignment

1. Analyze issue content to determine relevant labels:
   - Component labels: frontend, backend, infrastructure, mobile, API
   - Type labels: bug, feature, improvement, chore, documentation
   - Area labels: based on mentioned systems, services, or product areas
2. Use @Linear/Add Label to apply the determined labels

### Triage Execution

1. Use @Linear/Update Issue to set the priority field
2. Add a comment explaining the triage reasoning:
   - Why this priority was chosen
   - What labels were applied and why
   - Any recommendations for assignment or next steps
3. If auto-assign rules are provided, set the assignee accordingly

## Output

**Triage Report:**

**Team:** [Team Name]
**Issues Triaged:** [count]

**Priority Breakdown:**
- Urgent: [count] issues
- High: [count] issues
- Medium: [count] issues
- Low: [count] issues

**Actions Taken:**
| Issue | Title | Priority Set | Labels Added | Assigned To | Reasoning |
|-------|-------|-------------|-------------|-------------|-----------|
| [ID]  | [title] | [priority] | [labels] | [assignee] | [brief reasoning] |

**Issues Needing Human Review:**
- [Issue ID] [Title] - [reason it needs manual review]

**Summary:** [1-2 sentence overview of triage results]
```

## Related reading
- [Linear's Built-In Automations Aren't Enough. Here's What We Added.](https://cotera.co/articles/linear-api-automation-guide.md)

