Skip to content
safran

Type to search. Enter opens the first result.

    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: acme

    projects 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-1423
    read-issue.ts
    import { 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_KEY

    This 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

    FieldTypeDefaultRequiredMeaning
    idstringyesName of this entry.
    type"linear"yesSelects this plugin.
    token_envvariable nameyesVariable holding a personal API key (lin_api_…) or an OAuth access token.
    projectsstring[][]noTeam keys this tracker owns. Restricts reference matching, listProjects and neutral searches.
    workspacestringnoWorkspace slug, the first path segment of a linear.app URL. When set, URLs of other workspaces do not match.
    urlURLhttps://api.linear.app/graphqlnoGraphQL endpoint. Only changed for a proxy.

    Ticket references

    The canonical key is PAY-1423.

    InputWith projects: [PAY], workspace: acmeWith neither
    PAY-1423PAY-1423PAY-1423
    pay-1423PAY-1423not matched
    ENG-1not matchedENG-1
    utf-8not matchednot matched
    12, #12not matchednot matched
    https://linear.app/acme/issue/PAY-1423/kismi-iadePAY-1423PAY-1423
    https://linear.app/other/issue/PAY-1423/xnot matchedPAY-1423
    • With a projects list 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.app and have the form /<workspace>/issue/<KEY-123>; the slug after the key is ignored.
    • A bare number and #123 are never matched.

    What a ticket contains

    Ticket fieldSource in Linear
    key, title, urlidentifier, title, url
    statusThe workflow state's name
    statusCategoryThe workflow state's type: triage, backlog, unstarted → todo; started → in_progress; completed, canceled, duplicate → done
    projectThe team key
    descriptionMarkdown, as Linear stores it
    priorityThe priority label (Urgent, High, Normal, Low); absent when the issue has no priority
    labelsUp to 50 label names
    assignee, reporterAssignee, creator
    parentThe parent issue
    resolvedAtCompleted 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.

    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 fieldFilter
    projects (or the entry's projects when absent)Team key is one of them (upper-cased)
    textTitle or description contains the text, ignoring case
    statusCategoriesWorkflow state type is one of the types listed above for those categories
    updatedSinceUpdated 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.

    search-linear.ts
    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 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 as web links whose relation is the attachment's source type. Each of these lists is read up to LINEAR_LINK_PAGE entries.
    • 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 with UNSUPPORTED.

    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

    ConstantValueMeaning
    DEFAULT_PAGE_SIZE / MAX_PAGE_SIZE50 / 100Comments, history entries and search results per page.
    LINEAR_LINK_PAGE50Children, relations, inverse relations and attachments read by links, each.
    LINEAR_MAX_TEXT_CHARS250Characters of search text used.
    LINEAR_MAX_TEAM_PAGES10Pages of 100 teams read by listProjects.
    MAX_REF_LENGTH2048Longest 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 with AUTH_FAILED.
    • Error classification. Only RATELIMITED is 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 as UPSTREAM with Linear's message.

    See also