Skip to content
betterstack-alchemyUnofficial

Incidents.LinearIntegration

Kind ResourceType id BetterStack.Incidents.LinearIntegrationSource src/Incidents/LinearIntegration.tsOffline only Tested against the offline mock only: the lifecycle runs against the offline mock only (test/Incidents/LinearIntegration.test.ts).

A Linear integration creates Linear issues for your incidents. Take-over resource: the API cannot create or delete a Linear integration, because connecting one signs in to Linear with OAuth in a browser. Connect it once in the Better Stack web app, then name it here by integrationId: deploying configures that integration (team, status, assignee, project, labels, priority, automatic creation and closure), and destroying only forgets it — the integration stays connected, with the settings it had last.

Deploying fails when no integration has that id (it is never created). Every setting updates in place, and every Linear id is checked against the integration’s Linear workspace. Removing linearAssigneeId, linearStatusId, linearProjectId or linearResolvedStatusId clears it; removing another setting leaves its current value. linearLabels replaces the whole list (one label per Linear label group). automaticIssueClosure: true needs linearResolvedStatusId.

Configuring a connected Linear integration

Section titled “Configuring a connected Linear integration”

High-priority issues, closed when the incident resolves

yield* BetterStack.Incidents.LinearIntegration("linear", {
integrationId: "12345",
linearTeamId: "4f1c0e3a-team",
linearPriority: "high",
linearLabels: [{ id: "9b2d-incident-label" }],
automaticIssueCreation: true,
automaticIssueClosure: true,
linearResolvedStatusId: "c7aa-done-status",
});

integrationId string required

Id of a Linear integration already connected in the Better Stack web app (Integrations → Linear, which signs in to Linear with OAuth). Changing it manages another integration; the previous one is left as it is.

automaticIssueClosure boolean

Whether to move the issue to linear_resolved_status_id when the incident is resolved.

automaticIssueCreation boolean

Whether to create a Linear issue for every incident automatically.

linearAssigneeId string | null

ID of the Linear user that issues are assigned to. null leaves issues unassigned.

linearLabels UpdateIncidentsLinearIntegrationRequestLinearLabelsItem[]

Labels added to the issues created. Send each label as an object with its id, as a read returns it. An update replaces the whole list. Only one label from each Linear label group can be set.

linearPriority "no_priority" | "urgent" | "high" | "medium" | "low" | string

Priority of the issues created.

linearProjectId string | null

ID of the Linear project that issues are added to. null adds them to no project.

linearResolvedStatusId string | null

ID of the Linear status that issues move to when the incident is resolved. Required when automatic_issue_closure is true.

linearStatusId string | null

ID of the Linear status that issues start in. null uses the Linear team's default status.

linearTeamId string

ID of the Linear team that issues are created in.

name string

Integration name.

teamId string

Team that owns the resource, such as t123. Defaults to the credentials' team (BETTERSTACK_TEAM_ID, or the profile's team). Changing it replaces the resource.

id string always set

The incidents_linear_integration's id.

automaticIssueClosure boolean

Whether to move the issue to linear_resolved_status_id when the incident is resolved.

automaticIssueCreation boolean

Whether to create a Linear issue for every incident automatically.

linearAssigneeId string | null

ID of the Linear user that issues are assigned to. null leaves issues unassigned.

linearLabels IncidentsLinearIntegrationLinearLabelsItem[]

Labels added to the issues created.

linearPriority "no_priority" | "urgent" | "high" | "medium" | "low"

Priority of the issues created.

linearProjectId string | null

ID of the Linear project that issues are added to. null adds them to no project.

linearResolvedStatusId string | null

ID of the Linear status that issues move to when the incident is resolved.

linearStatusId string | null

ID of the Linear status that issues start in. null uses the Linear team's default status.

linearTeamId string

ID of the Linear team that issues are created in.

name string

Integration name.

teamId string

Team that owns this integration, such as t123.

teamName string

Name of the team that owns this integration.

LinearIntegration.lookup(props) reads an object this stack does not manage. It is never created, updated or deleted.

id string required

The integration's id.

teamId string

Team that owns it, such as t123. Defaults to the credentials' team.