Skip to content

Linear Integration

Connect Linear so Escape can create Linear issues from security issues, attach request evidence, and keep status in sync both ways.

Workflow Required for Issue Creation

A workflow must include a Linear export action before Escape can create Linear issues. After you connect the integration, create a workflow with that export action.

Configuration

Choose an Authentication Method

Pick one of these methods:

Method What you set up in Linear Escape acts as
OAuth (recommended) Nothing: you approve Escape when you save the integration Its own Linear app user
API key A personal API key The person who owns the key

With OAuth, the tickets are attributed to the Escape app, not to the person who approved it. The permissions are the same for both methods: Read and Create issues.

You choose the method when you create the integration. To switch, create another integration.

Create a Linear API Key

Skip this section if you connect with OAuth.

With an API key, Escape connects to Linear with a personal API key. The key acts as its owner, so create it from a dedicated Linear account to keep the tickets attributed to that account.

  1. In Linear, open Settings > Security & access.

  2. Create a Personal API key.

  3. Give it the Read and Create issues permissions. That's enough to create issues, move them to another state, and attach the evidence files.

  4. Copy the key. It starts with lin_api_.

Linear personal API key with the Read and Create and update issues permissions

Never share your API key

Don't reuse a personal key you also use elsewhere. Escape stores the key with the integration and never shows it again, so you enter it again when you edit the integration.

Create a Linear Integration

  1. Go to the Integrations page from the left navigation menu.

  2. Open the Linear card in the Ticketing section.

  3. Click +Create new integration.

  4. Set Enter your integration's name.

  5. Pick the method in Authentication. The OAuth tab is selected by default.

    • OAuth: nothing to enter. Go to Connect With OAuth after the next step.
    • API key: open the API key tab and paste the key in API key. Click Test Integration.
  6. Click Connect Integration.

Linear integration create form in Escape with the OAuth tab selected

Validation reads your Linear workspace with the key or the OAuth connection and creates nothing.

Linear is a cloud service, so Escape connects to it directly. The Network Configuration setting has no effect on this integration.

Connect With OAuth

  1. After you click Connect Integration on the OAuth tab, Escape sends you to Linear.

  2. In Linear, approve Escape's access to your workspace. Linear lists the permissions Escape asks for: read access, and creating and updating issues. It also asks which teams Escape can access: All public teams or Only select teams....

    Linear asking to authorize Escape with its permissions and team access

  3. Linear sends you back to Escape, which opens the integration settings and shows Authorized under Authentication.

  4. Click Test Integration to check the connection.

Until you approve Escape in Linear, the settings show Not authorized yet. Save to authorize Escape in Linear. and the integration can't create issues.

Linear integration settings showing Authorized, with Test Integration, Reconnect, and Save buttons

Connect Again

On an authorized integration, the settings page has Save and Reconnect. Save keeps the connection as it is. Click Reconnect to go to Linear and approve Escape again, for example when the connection is lost: see Troubleshooting. Reconnect is disabled while the form has unsaved changes, so save them first.

While the integration isn't authorized yet, the button reads Save and authorize and sends you to Linear.

Escape renews the connection in the background, so you don't approve it again while the integration works. You reconnect only when Linear no longer accepts the connection: see Troubleshooting.

Edit a Linear Integration

  1. Go to the Integrations page.
  2. Open the Linear card.
  3. Click Edit next to the integration.
  4. With the API key method, enter the API key again, because Escape doesn't show it. With OAuth, there is nothing to enter. Change the name if you need to.
  5. Click Save, then Test Integration. An OAuth integration that isn't authorized yet shows Save and authorize instead, which sends you to Linear.

The authentication method is locked on an existing integration.

Delete a Linear Integration

  1. Go to the Integrations page.
  2. Open the Linear card.
  3. Click Delete next to the integration.

Consequences of Deleting an Integration

Deleting the integration stops the workflows that export with it, and you can no longer create Linear issues from those workflows or from the issue sidepanel.

Update or remove those workflows first, or create a replacement integration.

Using Linear in Workflows

Add an Export action and select Linear, then pick the integration and the Linear team.

Supported workflow triggers:

Trigger What the export does
New Issue Creates and links a Linear issue
Manual Creates and links a Linear issue (run from the issue sidepanel menu)
Issue Updated Moves the linked Linear issue to a workflow state that matches the new Escape status

Linear export action form with the team, project, parent issue, and labels

Team, Project, Parent, and Labels

  • Linear team (required): the team that owns the issues. Changing the team clears the project, parent issue, labels, status mapping, and any fixed value that names a project, a cycle, or labels, because they belong to one team.
  • Project (optional, create triggers only): the Linear project the issues join.
  • Parent issue (optional, create triggers only): Escape creates every issue as a sub-issue of this one. Search it by title.
  • Labels (optional, create triggers only): labels added to every issue.

Default Fields

Escape always sets:

  • Title: the Escape issue name.
  • Description: the issue context and remediation, ending with a View in Escape: link to the issue.
  • Priority: from the severity.
Escape severity Linear priority
Critical Urgent
High High
Medium Medium
Low Low
Info No priority

A new issue starts in the Linear state that matches its Escape status. An open issue starts in the first unstarted state of the team, or the first backlog state if there's none. You can choose another state in the status mapping.

Fixed Values

Set a field to the same value on every issue created by the action: assignee, labels, project, cycle, estimate, or due date. The title, description, priority, and state come from Escape, so you can't set them here. Labels add up: the action labels and the fixed labels are all applied, without duplicates.

Linear fixed values with an estimate and a due date

  • Cycle: one of the team's cycles that hasn't ended. The cycle is fixed, so when it ends, pick the next one.
  • Estimate: a whole number, 0 or more.
  • Due date: a date.

Escape writes these values when it creates the issue. It applies no logic to them and doesn't sync them afterwards.

A fixed value that doesn't fit its field is left out with the warning Some fixed values were skipped, and the issue is still created. For example, an assignee that isn't a Linear user, an estimate that isn't a whole number, or a date that doesn't exist.

Evidence

After creating an issue, Escape attaches the HTTP exchanges of the issue as files named exchange-{id}.json. If Linear refuses to store the files, Escape logs the warning Evidence upload was refused once and creates the issues without files. Any other upload failure is logged as Failed to attach evidence to the issue and skips that file only.

Usage

Creating Linear Issues From Workflows

When a New Issue workflow fires, Escape creates one Linear issue per matching issue, then stores the Linear issue and its URL on the Escape ticket. A retry after a lost answer links the existing Linear issue instead of creating a second one, and uploads its evidence.

Creation skips Ignored and False Positive issues. An export with only Ignored or False Positive issues fails. Existing tickets are skipped with the warning Export skipped: issue already has a ticket, including tickets from other workflows. Manual can recreate a Linear issue only when its ticket belongs to that workflow and Linear no longer lists the issue.

Creating Linear Issues Manually

  1. Open an issue sidepanel.
  2. Open the menu (⋮) at the top right of the panel.
  3. Under Run a workflow, select a workflow whose export action uses Linear.

The workflow's team, project, parent, labels, and fixed values are used. The menu then shows a Linked Ticket card with the key of the Linear issue, its title, and its current Linear state, read live from Linear. If someone deletes the Linear issue, the card shows Not found, and you can run a workflow again to create a new one.

Issue sidepanel menu with its linked Linear issue

Bi-Directional Status Sync

Escape keeps the status of an issue and the state of its Linear issue in step. The later change wins: if you change the Escape status after the last state change in Linear, Escape moves the Linear issue. If someone changes the state in Linear after the last Escape status change, the Escape issue takes the new status. Equal times write nothing.

Status Mapping

Add the optional Status mapping to an Issue Updated export to choose the workflow state for each Escape status. The list shows the states of the selected team with their type. Without a choice, the default applies.

Status mapping from each Escape status to a Linear state

Escape status Default Linear state
Open First unstarted state
Resolved First completed state
Ignored First canceled state
False Positive First canceled state
Manual Review Don't change the Linear issue

Escape picks states by their type, never by their name, so a team that renamed Done to Shipped still works. The first state of a type is the first one on the board.

Escape to Linear

Use a workflow with the Issue Updated trigger and a Linear export.

Escape moves a Linear issue only when it isn't already where the new status puts it. A started issue isn't moved back to unstarted when you reopen the Escape issue, and a completed issue isn't moved again when you resolve it. A canceled issue is closed but isn't resolved, so resolving the Escape issue moves it to the first completed state. When a move is needed, Escape uses the state you mapped for the new status.

A Linear issue that is archived or deleted isn't moved. Escape logs a warning, and you can create a new one with a Manual workflow.

Linear to Escape

No extra workflow is required.

Escape runs a built-in pull for each Linear integration at least once a day. It also runs after you create or update the integration, and when you click the refresh button next to Lastly Pulled on the integration page. The pull reads every Linear issue the integration created and compares its state with the Escape issue.

Linear state type Escape status
completed Resolved
canceled, duplicate Ignored
triage, backlog, unstarted, started Open

A state you mapped in the Issue Updated action of the same team wins: it stands for the Escape statuses mapped to it. When several statuses map to one state, the current status of the issue wins.

Some statuses protect themselves from a scan:

  • A False Positive or Ignored issue stays as it is when its Linear issue is completed or canceled. The closed Linear issue already stands for it.
  • An open Linear issue doesn't change a Manual Review issue.
  • A later scan that still finds the issue doesn't outrank a change you made in Linear after you set one of these statuses. For an Open or Resolved issue it does count: a scan that finds a resolved issue again reopens its Linear issue.

The pull writes the Escape status directly, so it never starts an Issue Updated workflow and nothing loops.

Several Teams

A status mapping holds the states of one Linear team. If your issues go to several teams, create one New Issue workflow and one Issue Updated workflow for each team, with the same filters on the Escape side. Escape filters issues by their own properties, not by Linear team.

An Issue Updated workflow skips a Linear issue that belongs to another team when the status is mapped, with the warning Status sync skipped: ... is in another Linear team. A status with no mapping moves the issue by state type, in the team the issue belongs to. The pull uses the Issue Updated workflow of the team the Linear issue is in.

Troubleshooting

Message What it means
Evidence upload was refused Linear refused to store the evidence files for this connection. Issues are created without evidence files.
Some fixed values were skipped A fixed value doesn't fit its Linear field. The issue is created without it.
Export skipped: issue already has a ticket The issue is already linked to a Linear issue.
Status sync skipped: ticket belongs to another integration The Linear issue was created through another Linear integration, so this one doesn't touch it.
Status sync skipped: ... is in another Linear team The status is mapped, and the Linear issue isn't in the team of this action. See Several Teams.
Linked Linear issue ... was not found, or is archived or deleted Linear no longer lists the issue. Run a Manual workflow to create a new one.
Linear request … failed with HTTP 429, or Linear could not … with a rate limit message Linear refused the requests because the key is over its request limit. The run stops, and the next run retries.
Linear status mapping cannot be applied The mapped state is archived, belongs to another team, or the team has no state of the needed type. Edit the status mapping.
Connect with Linear is not available yet. OAuth isn't enabled for your Escape environment. Use the API key method, or ask your Escape contact.
Save the integration with OAuth before Connect The integration isn't saved with the OAuth method yet. Save it, then connect.
The integration changed while saving tokens. Start Connect again. Someone saved the integration while you were approving Escape. Click Reconnect, or Save and authorize if the settings still show Not authorized yet.
The Linear integration is not connected yet. Connect the integration to Linear first. Nobody approved Escape in Linear yet. Open the integration settings and click Save and authorize.
Linear rejected the access token (HTTP 401). Connect the integration to Linear again. Linear no longer accepts the connection. Click Reconnect in the integration settings.
Linear refused to renew the connection. Connect the integration to Linear again. Linear refused the background renewal. Click Reconnect in the integration settings.
The Linear connection could not be renewed. Connect the integration to Linear again. The renewal failed. Click Reconnect in the integration settings.