---
title: Triage rules in Venom Tasks
description: Route new issues as they land in a team's Triage, by label, creator, source, text or priority, and set their team, status, assignee, agent, labels, priority, project or cycle; ordered, first match wins, recorded on the issue.
section: cloud
order: 84
audience: [user, operator, agent]
sources: [services/nodejs-cloud/lib/tasks/triage-rules.ts, services/nodejs-cloud/components/tasks/TriageRules.tsx, services/nodejs-cloud/components/tasks/triage-rules-model.ts, "services/nodejs-cloud/app/tasks/api/teams/[id]/triage-rules", "services/nodejs-cloud/app/tasks/api/triage-rules/[id]", services/nodejs-cloud/migrations/0248_tasks_triage_rules.sql, services/nodejs-cloud/migrations/0249_tasks_issue_source.sql]
features: [cloud.tasks]
---

Issues reach a team's Triage from forms, Support, GitHub, agents and other teams. A triage rule routes them as they
arrive: "bugs from Support go to Platform with high priority", "anything mentioning billing is Ana's", "issues an
agent files are delegated back to it and accepted into Todo". You keep triaging by hand what no rule takes.

## Set one up {#setup}

Open the team's settings (`/tasks/settings/teams/<KEY>`) and go to **Triage rules**. **New rule** asks for:

- a **name**: the issue's activity shows it;
- **when**: conditions built with the same filter bar as the issue list (status, priority, assignee, agent, labels,
  project, cycle, creator, due date; each chip "is" or "is not" any of its values), the search box for text in the
  title or description, and **Came from** for the issue's source. No conditions means every issue;
- **then**: what the rule sets. Any of: move to another team, accept into a status, an assignee, an agent (the
  delegate), labels to add, a priority, a project, a cycle (one of the team's, or "the current cycle" / "the next
  cycle" at the time the rule runs).

**Try it** runs the rule against the team's last 50 issues that came through Triage, without changing anything: it
lists the issues it matches (as they are now) and, for each, the rule above it that would take the issue first.

Each rule in the list shows its conditions and actions in words and how often it was applied. Turn a rule off and on
with its switch, move it up or down, edit or delete it. The team's admins and the organisation's owners and admins
change rules; everyone who sees the team can read them and try them. Rules only run while the team has Triage on.

## How rules run {#order}

- **When.** An issue meets the team's rules when it lands in the team's Triage: created there, moved into the triage
  status, or moved to the team while it is in triage. Edits to an issue that stays in triage don't run them again.
- **Order, first match wins.** The team's enabled rules are checked top to bottom against the issue as it is at that
  moment. The first one whose conditions match is applied and no other rule of the team is. Two rules that both match
  never fight: the higher one wins, and moving it lower changes that.
- **No loops.** The rule's changes are written as the rule (the actor `rule:<id>`), and a rule's own changes never
  start the rules again. The one way on: a rule that moves the issue to another team while it stays in triage hands
  it to that team's rules. Each team's rules meet the issue once per arrival, so teams that send an issue back and
  forth stop after one round (at most five teams in a row).
- **"Me" never matches.** A rule has no "me": write the person instead.
- **Moves.** A rule can't move issues into a private team (the person who filed the issue would lose it). The status
  it accepts into belongs to the team the issue ends up in, and so do the labels and the cycle. A move keeps the issue
  in the new team's Triage unless the rule also accepts it.

## On the issue {#activity}

Every application is in the issue's activity: "Triage rule applied the rule “Bugs to Platform”", then each change
it made, marked **via rule: Bugs to Platform**. A renamed rule shows its new name; a deleted one, the name it had.

When a rule matches but can't be applied (a label, status, person or team it names is gone, or the team it moves to
went private), the issue is filed anyway, untouched by the rule, and the activity says **could not apply the rule**
with the reason. Fix the rule and accept the issue by hand.

## Conditions reference {#conditions}

A rule's conditions are a filter in the language the issue list and saved views use
([filters](/docs/cloud/tasks-api.md#list-query-parameters)). Two fields are there for rules and work in views too:

| Field | Operators | Values |
|---|---|---|
| `source` | `is`, `isNot`, `in`, `notIn`, `isEmpty`, `isNotEmpty` | where the issue came from: `app`, `api`, `agent` (an agent or an MCP client), `support`, `forms`, `github`, `comms`, `incidents`, `calendar`, `funnel`, `globe`, `recurring`. Issues made before sources were recorded have none |
| `description` | `contains`, `notContains` | text, case-insensitive |

The editor writes "text contains" as `{or: [title contains, description contains]}` and keeps any condition it has
no control for (a rule made over the API) as it is.

## API and MCP {#api}

| Endpoint | MCP tool | Does |
|---|---|---|
| `GET /tasks/api/teams/{id}/triage-rules` | `tasks_triagerule_list` | the team's rules, in order |
| `POST /tasks/api/teams/{id}/triage-rules` | `tasks_triagerule_create` | add a rule at the end: `name`, `actions`, optional `filter` (default every issue) and `enabled` |
| `GET /tasks/api/triage-rules/{id}` | `tasks_triagerule_get` | one rule, with `appliedCount` and `lastAppliedAt` |
| `PATCH /tasks/api/triage-rules/{id}` | `tasks_triagerule_update` | change `name`, `filter`, `actions`, `enabled` |
| `DELETE /tasks/api/triage-rules/{id}` | `tasks_triagerule_delete` | delete it; issues it routed keep their changes |
| `POST /tasks/api/teams/{id}/triage-rules/reorder` | `tasks_triagerule_reorder` | `ids`: every rule id of the team, in the new order |
| `POST /tasks/api/teams/{id}/triage-rules/test` | `tasks_triagerule_test` | the dry run: `filter`, or `ruleId` (a saved rule, in its place) |

The REST twins of the tools are under `/api/v1/tasks/…` with an API key, as for every Tasks tool
([the REST API](/docs/developers/rest.md)).

`actions` takes `teamId`, `stateId` (not a triage status), `assigneeId` (a member uid, or `null` to clear),
`delegateAgentId`, `labelIds` (added to the issue's), `priority` (0 none, 1 urgent … 4 low), `projectId`, and
`cycleId` (an id, `current` or `next`). At least one. A team keeps up to 50 rules.

```bash
curl -X POST https://cloud.usevenom.dev/api/v1/tasks/teams/ENG/triage-rules \
  -H "authorization: Bearer vck_…" -H "content-type: application/json" \
  -d '{"name":"Support bugs are high","filter":{"and":[{"field":"source","op":"is","value":"support"},{"field":"label","op":"in","value":["<bug label id>"]}]},"actions":{"priority":2}}'
```

| Error | When |
|---|---|
| `400 invalid_filter` | the filter is not a valid Tasks filter |
| `400 invalid_request` | no action, an unknown action, a triage status, a move to the same or a private team |
| `400 wrong_team` | the status or cycle belongs to another team than the one the issue ends up in |
| `400 too_many` | the team already has 50 rules |
| `403 forbidden` | not a team admin nor an org owner or admin |

## Related

- [Venom Tasks](/docs/cloud/tasks.md#triage): the Triage list and its keys.
- [Tasks API](/docs/cloud/tasks-api.md) and [Tasks over MCP](/docs/cloud/tasks-mcp.md).
