> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sazabi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# File tickets

> File tickets in Linear, Jira, or GitHub Issues for Sazabi issues automatically by rule, on demand from an issue, or by linking one you already have.

Sazabi can file a ticket in your tracker for an issue it opens, so the work lands where your team already plans it. The ticket links back to the Sazabi issue, the issue lists the ticket under **Linked**, and each issue gets at most one ticket however it was filed. Three trackers are supported: Linear, Jira, and GitHub Issues. A ticket is called a **task** in the settings, the CLI, and the API.

There are four ways a ticket comes to exist:

| Route | Trackers | Who or what starts it |
| - | - | - |
| [Automatic rules](#file-tickets-automatically) | Linear, Jira, GitHub | A new issue that matches a rule in your project |
| [Create Linear ticket](#create-a-ticket-from-an-issue) | Linear | A person, from the issue page or the CLI |
| [Ask the agent](#ask-the-agent-to-file-a-ticket) | Linear, Jira, GitHub | A person, in a thread |
| [Link an existing ticket](#link-a-ticket-you-already-have) | Linear, Jira, GitHub | A person, from the issue page or the CLI |

## File tickets automatically

Each project has an ordered list of **creation rules**. When Sazabi opens a new issue, it checks the rules from top to bottom and the first enabled rule that matches files one ticket in that rule's tracker. Rules run when an issue is first opened, after its description is written so the ticket carries it, and again if the issue later gains a type that a rule matches. Rules are scoped to one project, and every project keeps its own list.

A rule has four parts:

* **Tracker**: one of the Linear, Jira, or GitHub connections your organization has set up.
* **Conditions**: all must match. Severity reads **Severity is at least**, so a rule set to high also matches critical. You can also match on issue **Type** (an issue with any of the types you pick matches), and on components or on the team that owns the component. No conditions means every issue matches. See [Route notifications](https://docs.sazabi.com/triage/notifications.md#delivery-rules) for how components and teams are matched.
* **Destination**: the Linear team, the Jira project, or the GitHub repository (`owner/repo`) the ticket is filed in.
* **Defaults**: an initial state, and an item type where the tracker has them. Jira requires an item type for every rule. Linear and GitHub have none to set.

### Set up a rule in the dashboard

**Step 1**

### Open Tasks

Go to [**Settings > Tasks**](https://app.sazabi.com/settings/task-creation) for the project and click **Add rule**. The page is empty until a tracker is connected under [**Settings > Integrations**](https://app.sazabi.com/settings/integrations).

**Step 2**

### Choose a tracker and conditions

Pick a connection under **Choose a tracker**, then set severity, type, and component or team conditions under **Set conditions**.

**Step 3**

### Choose a destination and defaults

Pick the team, project, or repository under **Choose a destination**. Under **Set task defaults**, choose an item type if the tracker asks for one, and an initial state (the default is the tracker's own).

**Step 4**

### Save and order the rules

Click **Save rule**. Use the arrows on each row to reorder rules, since the first match wins, and the toggle on a row to disable a rule without deleting it.

A rule marked **Needs attention** points at a connection that is no longer active. Edit the rule to choose another connection, or reconnect it on the tracker's integration page. Until then the rule files nothing.

### Set up a rule with the CLI

```bash theme={"system"}
# Linear: high and critical issues into one team (the team's ID, not its key)
npx -y @sazabi/cli@latest tasks rules create --connection-id your-connection-id --provider linear --container-id your-linear-team-id --min-severity high

# Jira: every issue into project PROJ as a Bug
npx -y @sazabi/cli@latest tasks rules create --connection-id your-connection-id --provider jira --container-id PROJ --default-item-type Bug

# GitHub Issues: every issue into acme/api
npx -y @sazabi/cli@latest tasks rules create --connection-id your-connection-id --provider github --container-id acme/api

npx -y @sazabi/cli@latest tasks rules list
```

For Linear, `--container-id` takes the team's UUID from Linear's API, not its short key such as `ENG`: the CLI saves the value as given and Linear rejects a key. The dashboard form picks the team from a list, so it needs no ID.

`--types`, `--component-ids`, `--team-ids`, `--default-state`, `--priority`, and `--disabled` are also available. A rule can match on components or on teams, not both. Find the connection ID with `sazabi integrations list`. See [`sazabi tasks`](https://docs.sazabi.com/reference/cli/tasks) for every option.

### What the ticket contains

The title is the issue's severity and name, such as `[HIGH] Checkout requests are timing out`. The body opens with a line summarizing the issue, then its description, then a link to the Sazabi issue (the ticket's link back). A **Prompt for AI agents** section at the end holds a brief a coding agent can work from, so you can hand the ticket to one from the tracker.

Automatic creation uses the organization's connection to the tracker, not a person's account, so the tracker shows the connection's authorizing user as the author. For Jira, authorize with a dedicated service account for that reason.

## Create a ticket from an issue

When your project files into Linear and an open issue has no ticket yet, the issue page shows **Create Linear ticket** beside **Fix**. It files the ticket where the project's Linear rule files (or, with no rule, in the Linear integration's default team), with the same contents as an automatic ticket. The ticket then appears under **Linked**, and the button goes away. If the issue already has a ticket, Sazabi returns that ticket instead of filing another.

The CLI equivalent takes the issue ID:

```bash theme={"system"}
npx -y @sazabi/cli@latest issues create-task "$ISSUE_ID"
```

This action exists for Linear only. For Jira and GitHub Issues, use a rule, or file the ticket and link it.

## Ask the agent to file a ticket

In a thread, ask the agent to file a ticket ("open a Jira bug for this and put the repro steps in it"). The agent creates it with the same operation as `sazabi tasks create`, and can comment on a ticket or move it to another state the same way. The destination comes from your request, or from the default set on the tracker's integration page: the **Default team** for Linear, the **Default project** (and **Default issue type**) for Jira, the **Default repository** for GitHub.

```bash theme={"system"}
npx -y @sazabi/cli@latest tasks create --container ENG --title "Fix login bug" --body-markdown "Steps to reproduce..."
```

`--container` accepts an ID, a short key such as `ENG`, or a name; for GitHub it is `owner/repo`. Pass the same `--client-request-id` when retrying so a lost response does not file a duplicate.

A ticket created this way is not attached to a Sazabi issue. Link it afterwards (below) if you want it under **Linked** and in status sync.

Who the tracker shows as the author depends on the tracker:

* **Linear**: the requesting person's own Linear account when they have connected one under [**Settings > Connected accounts**](https://app.sazabi.com/settings/connected-accounts), otherwise the organization's connection.
* **Jira and GitHub**: always the organization's connection. GitHub issues are filed by the Sazabi GitHub App, and a personal GitHub connection is not used for them.

Whenever the organization's connection is used for a ticket a person asked for, Sazabi appends *Requested by (name) via Sazabi* to the body so the tracker records who directed it.

## Link a ticket you already have

On an issue page, click **Link task** under **Linked**, then search your connected trackers by title, identifier, or URL. An empty search lists recently updated tickets. A linked ticket is treated like one Sazabi filed: it shows under **Linked** and takes part in status sync. If a person links a ticket before a rule runs, the rule files nothing.

```bash theme={"system"}
npx -y @sazabi/cli@latest issues link-task "$ISSUE_ID" ENG-123
npx -y @sazabi/cli@latest issues link-task "$ISSUE_ID" https://linear.app/acme/issue/ENG-123
npx -y @sazabi/cli@latest issues link-task "$ISSUE_ID" acme/api#42
```

Identifiers look like `ENG-123` in Linear and Jira and `owner/repo#42` in GitHub. A URL from a different Linear workspace or Jira site than your connection is refused, so a same-key ticket elsewhere is never linked by mistake.

## How the trackers differ

| | Linear | Jira | GitHub Issues |
| - | - | - | - |
| Destination | Team | Project | Repository (`owner/repo`) |
| Item type | None | Required for rules | None |
| States | Your workflow states | Your project's workflow | Open, closed as completed, closed as not planned |
| Personal account for agent-filed tickets | Yes, when connected | No | No |
| Defaults and status mapping | [**Settings > Integrations > Linear**](https://app.sazabi.com/settings/integrations/linear) | [**Settings > Integrations > Jira**](https://app.sazabi.com/settings/integrations/atlassian) | [**Settings > Integrations > GitHub**](https://app.sazabi.com/settings/integrations/github) |

GitHub Issues needs the Sazabi GitHub App's **Issues** permission (read and write). An installation that has not accepted that permission cannot file issues until an organization owner approves it on GitHub. Jira ticket bodies are converted to Atlassian's document format, so formatting follows what Jira renders.

## Keep issues and tickets in step

Filing is one direction. To keep statuses matched afterwards, turn on **Status mapping** on the tracker's integration page and choose which tracker state each Sazabi status (Open, Resolved, Ignored) maps to. Closing a ticket then resolves the issue, and resolving or ignoring the issue moves the ticket. It works for every linked ticket, however it was filed. Map the states from the CLI with `sazabi tasks mapping`.

## Verify

Open the issue page for an issue your rule matches, or click **Create Linear ticket** on an open one. Confirm the ticket appears in your tracker's destination with the `[SEVERITY] name` title and a link back to the Sazabi issue, and that the issue page lists the ticket under **Linked**.

## Troubleshooting

**No ticket was filed.** Check that the rule is enabled and that no earlier rule matched first. Confirm the issue was opened after the rule was saved, since rules do not backfill existing issues, and that the rule does not show **Needs attention**. An issue that already has a linked ticket never gets a second one.

**Jira rule won't save.** Jira needs an item type on every rule. Choose one under **Set task defaults**.

**GitHub rule fails with a permission error.** The installation has not accepted the GitHub App's Issues permission, or the repository is outside the installation's access. Review the app under your organization's **GitHub Apps** settings on GitHub.

**No Create Linear ticket button.** The issue must be open, have no ticket, and belong to a project that files into Linear (a Linear rule, or a default team on the Linear integration page). You also need write access to the project.

## Further reading

> [card] [Route notifications](https://docs.sazabi.com/triage/notifications.md)
>
> Delivery rules use the same conditions as task creation rules.

> [card] [sazabi tasks](https://docs.sazabi.com/reference/cli/tasks.md)
>
> Every option for tickets, rules, and status mapping.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.