# General

URL: https://docs.usestitch.ai/docs/triggers/linear



## Setup [#setup]

In **Integrations → Linear**, enter a connection slug and add the signing secret from Linear's
new webhook form and a personal API key with Read permission. Limit the key to the
teams you need. Stitch verifies the API key's workspace and encrypts both credentials.

Copy the returned URL into Linear. Select **Issues** and **Comments**, select the team
scope, and save the webhook. The connection shows when its first signed delivery arrives.
The slug must be unique within your Stitch organization. Use lowercase letters, numbers,
and hyphens, starting with a letter (up to 64 characters). Reference it as `linear.connection`
in `stitch-factory.yaml`, then sync the repository. One connection and webhook can serve
several workflows; each event is checked against every workflow that references the slug.
The webhook URL uses the integration ID. Resource buttons show accessible teams,
projects, workflow states, labels, and users with their IDs.

<Callout type="warning">
  Replace credentials without changing the URL. Disconnecting blocks new and queued work; also
  disable the webhook in Linear.
</Callout>

<Callout type="warning" title="Configure Linear MCP access separately">
  The Linear integration's API key does not give your agent access to Linear. To let
  the agent interact with Linear through MCP, add a Linear MCP server to your harness agent's
  configuration in the repository. Configure its authentication to read an environment
  variable such as `LINEAR_API_KEY`.

  Store a Linear API key with the permissions the agent needs as a
  [Stitch secret](/docs/resources/secrets/managing), then reference it in
  `stitch-factory.yaml` to inject it into the agent's environment. Do not commit the
  key to the repository.

  ```yaml
  execution:
    environmentVariables:
      - key: LINEAR_API_KEY
        source: managed
        secretName: LINEAR_API_KEY
        targets: [harness]
  ```

  The environment variable name must match the one in your harness agent's MCP configuration.
</Callout>

## Events and filters [#events-and-filters]

[Linear trigger JSON Schema](/schema/linear.json) · [Factory schema](/schema/factory.json)

Supported subscriptions are `Issue/create`, `Issue/update`, and `Comment/create`.
Declare create and update separately. Updates require `changedFields` or `addedLabelIds`;
comments require `commands`, `keywords`, or `mentionedUserIds`. Valid unsupported webhook events are acknowledged without work.

| Field under `linear`                               | Meaning                                                                                                              |
| -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `connection`                                       | Required connection slug from Integrations → Linear.                                                                 |
| `teamIds`, `projectIds`, `stateIds`, `assigneeIds` | Match any selected ID.                                                                                               |
| `labelIds`, `labelOperator`                        | Match labels with `has_any`, `has_all`, or `has_none`.                                                               |
| `addedLabelIds`                                    | Issue update added at least one selected label.                                                                      |
| `changedFields`                                    | Issue update changed any of `stateId`, `assigneeId`, `labelIds`, `projectId`, `priority`, `title`, or `description`. |
| `commands`                                         | Comment's first token matches a selected slash command, case-sensitive.                                              |
| `humanActorsOnly`                                  | Require a human user actor.                                                                                          |
| `actorIds`                                         | Require one of the selected actor IDs.                                                                               |
| `creatorIds`                                       | Issue creator IDs, not the event actor.                                                                              |
| `issueIds`                                         | Issue UUIDs; on comments, matches the parent issue rather than the comment ID.                                       |
| `issues`                                           | Exact issue identifiers such as `ENG-42`.                                                                            |
| `projects`, `states`                               | Exact project or workflow-state names.                                                                               |
| `teams`                                            | Exact team names or keys such as `ENG`.                                                                              |
| `labels`                                           | Exact label names using `labelOperator`.                                                                             |
| `keywords`                                         | Any case-insensitive substring in issue title/description or the new comment body.                                   |
| `mentionedUserIds`                                 | User IDs in Linear profile mention links in the issue description or comment body. Plain names do not count.         |

ID filters also accept `assignee_ids`, `creator_ids`, `issue_ids`, `project_ids`,
`state_ids`, `team_ids`, and `mentioned_user_ids`. Use one spelling per setting.
Aliases normalize to camelCase. Each list permits at most 50 unique non-empty
values. Name and identifier matches are case-sensitive. ID and name filters are
separate conditions: if both are set, both must pass.

All configured filters must pass. Issue filters use event-time webhook values and
`updatedFrom`, including null previous values. Name/identifier/creator filters fetch
missing issue details when needed. Comment issue filters fetch the parent's current
state when processed. Keyword and mention filters use only the event's own text,
not the parent issue's text for comments. Mentions use Markdown links such as
`[Name](https://linear.app/workspace/profiles/user-id)`. Required data must be available; a failed lookup never
passes a filter. Temporary API failures are retried. A revoked key needs replacement.

See [Issue events](/docs/triggers/linear/issue) and
[Comment events](/docs/triggers/linear/comment) for configuration examples.

## Concurrency [#concurrency]

Set top-level `concurrency` with `scope: subject` or `scope: repository` and an integer
`limit` from 1 to 100. Subject means the issue UUID, including for comments on that
issue. Limits are per trigger, Linear connection, and execution repository. Runs wait
in the queue until capacity is available. Omit the setting for no trigger-specific limit.

Existing run reservations prevent duplicate admission and let retries resume failed
launch publication. There is no separate Linear delivery receipt. Events that do not
reserve a run can be evaluated again on retry; comment issue filters can then see newer state.
