Linear
The linear tracker reads issues from Linear through its GraphQL API: fields, comments, links, history and search. It is read-only. It has no attachment download and no native query language; this page says what it does instead, next to the profile entry and the reference forms it accepts.
Profile entry
- id: linear
type: linear
token_env: LINEAR_API_KEY
projects: [PAY, MOB]
workspace: acmeprojects holds team keys: the PAY in PAY-1423.
safran ticket PAY-1423 --links
safran ticket https://linear.app/acme/issue/PAY-1423/kismi-iade
safran ticket linear:PAY-1423import { createSafran } from "@safran/core";
await using safran = await createSafran({ profile: "safran.yaml" });
const issue = await safran.tickets.get("PAY-1423");
console.log(issue.title, issue.status, issue.priority, issue.fields.Cycle);
const links = await safran.tickets.links("PAY-1423");
for (const link of links) console.log(link.kind, link.relation, link.ticket?.key ?? link.url);Authentication
token_env names a variable holding a personal API key or an OAuth access token. A personal API key is sent in the Authorization header as it is, without a scheme, which is what Linear documents. A token that starts with lin_oauth_ is sent as Bearer.
The source names no scope. The key needs read access to the teams whose issues you want to read.
Without a workspace or team list
- id: linear
type: linear
token_env: LINEAR_API_KEYThis works, with two differences: any upper-case KEY-123 is accepted as a reference, and issue URLs of every workspace on linear.app match. Set workspace and projects when the profile has another tracker.
Configuration reference
| Field | Type | Default | Required | Meaning |
|---|---|---|---|---|
id | string | yes | Name of this entry. | |
type | "linear" | yes | Selects this plugin. | |
token_env | variable name | yes | Variable holding a personal API key (lin_api_…) or an OAuth access token. | |
projects | string[] | [] | no | Team keys this tracker owns. Restricts reference matching, listProjects and neutral searches. |
workspace | string | no | Workspace slug, the first path segment of a linear.app URL. When set, URLs of other workspaces do not match. | |
url | URL | https://api.linear.app/graphql | no | GraphQL endpoint. Only changed for a proxy. |
Ticket references
The canonical key is PAY-1423.
| Input | With projects: [PAY], workspace: acme | With neither |
|---|---|---|
PAY-1423 | PAY-1423 | PAY-1423 |
pay-1423 | PAY-1423 | not matched |
ENG-1 | not matched | ENG-1 |
utf-8 | not matched | not matched |
12, #12 | not matched | not matched |
https://linear.app/acme/issue/PAY-1423/kismi-iade | PAY-1423 | PAY-1423 |
https://linear.app/other/issue/PAY-1423/x | not matched | PAY-1423 |
- With a
projectslist only those teams match, in any letter case. Without one, any team matches but only in upper case, as Linear writes it. - URLs must be on
linear.appand have the form/<workspace>/issue/<KEY-123>; the slug after the key is ignored. - A bare number and
#123are never matched.
What a ticket contains
Ticket field | Source in Linear |
|---|---|
key, title, url | identifier, title, url |
status | The workflow state's name |
statusCategory | The workflow state's type: triage, backlog, unstarted → todo; started → in_progress; completed, canceled, duplicate → done |
project | The team key |
description | Markdown, as Linear stores it |
priority | The priority label (Urgent, High, Normal, Low); absent when the issue has no priority |
labels | Up to 50 label names |
assignee, reporter | Assignee, creator |
parent | The parent issue |
resolvedAt | Completed time, otherwise cancelled time |
type is not set: Linear issues have no issue type.
Ticket.fields
Four entries, each only when the issue has a value: Estimate (number), Due date, Project (the Linear project's name) and Cycle (its name, or Cycle <number>). There is no custom_fields option.
Search
There is no query language to build, so a neutral TicketSearchQuery becomes a Linear IssueFilter object. It travels as a GraphQL variable: user text is data and cannot change the shape of the query.
| Query field | Filter |
|---|---|
projects (or the entry's projects when absent) | Team key is one of them (upper-cased) |
text | Title or description contains the text, ignoring case |
statusCategories | Workflow state type is one of the types listed above for those categories |
updatedSince | Updated at or after the date |
Results are ordered by update time. text is cut to LINEAR_MAX_TEXT_CHARS characters and matched as one phrase, not word by word.
native is not supported. Passing it with tracker: "linear" fails with UNSUPPORTED; in a search across all trackers, Linear is left out and named in the result's warnings.
import { createSafran } from "@safran/core";
await using safran = await createSafran({ profile: "safran.yaml" });
const page = await safran.tickets.search(
{ text: "iade", statusCategories: ["todo", "in_progress"], updatedSince: "2026-01-01" },
{ tracker: "linear", limit: 20 },
);
for (const item of page.items) console.log(item.key, item.status, item.title);Comments, links, history
- Comments are paged with Linear's own cursor.
- Links returns the parent, children, relations in both directions and attachments. Relation types are worded with their direction:
blocks/is blocked by,duplicates/is duplicated by,relates to,similar to. Linear attachments are links to other systems (a pull request, a design file, a support thread); they are returned asweblinks whose relation is the attachment's source type. Each of these lists is read up toLINEAR_LINK_PAGEentries. - History returns one entry per change of: status, assignee, title, priority, estimate, due date, parent, project, cycle, team, labels, archived, trashed. For the description Linear records only that it changed, so the entry reads
description → (updated). - Attachments as files do not exist in this tracker.
safran.tickets.attachments(…)fails withUNSUPPORTED.
Errors
Linear reports most failures with HTTP 200 and an errors array, some with HTTP 400 and the same body. The connector maps both, so callers only see Safran codes: RATE_LIMITED, AUTH_FAILED, NOT_FOUND (with the ticket hint), INVALID_INPUT, and UPSTREAM for everything it cannot classify. An issue that does not exist comes back as null and is reported as NOT_FOUND.
Limits
| Constant | Value | Meaning |
|---|---|---|
DEFAULT_PAGE_SIZE / MAX_PAGE_SIZE | 50 / 100 | Comments, history entries and search results per page. |
LINEAR_LINK_PAGE | 50 | Children, relations, inverse relations and attachments read by links, each. |
LINEAR_MAX_TEXT_CHARS | 250 | Characters of search text used. |
LINEAR_MAX_TEAM_PAGES | 10 | Pages of 100 teams read by listProjects. |
MAX_REF_LENGTH | 2048 | Longest input looked at as a ticket reference. |
listProjects returns teams. A team's url is only filled in when workspace is set.
Known caveats
This connector is implemented from Linear's developer documentation and published GraphQL schema and tested against recorded-shape fixtures; it has not been run against a live workspace. See verification status. The following are marked UNVERIFIED in the source:
- OAuth tokens. The
lin_oauth_prefix is how the connector tells an OAuth access token from a personal API key. A token with any other prefix is sent bare, as an API key. If an OAuth token of yours has another prefix, requests fail withAUTH_FAILED. - Error classification. Only
RATELIMITEDis a documented error code. The other codes the connector recognises (authentication, forbidden, not found, invalid input) and the "not found" wording are taken from observed responses. An error it does not recognise is reported asUPSTREAMwith Linear's message.
See also
- Connectors overview for the rules shared by all connectors.
- Multiple sources for profiles with more than one tracker.
- Tickets in the SDK.