Skip to content
betterstack-alchemyUnofficial

Errors.LinearIntegration

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

An Error tracking Linear integration: which errors are filed as Linear issues, with which issue properties, and how errors and issues are kept in sync.

The API cannot create or delete one: connect Linear in the Better Stack web app first (it needs Linear’s OAuth consent), then this resource takes over the integration named by integrationId and applies the settings you declare. Destroying the resource only forgets it; the integration and its settings stay in Better Stack. A missing integrationId fails the deploy.

applications, tagFilter and linearLabelIds are replaced as a whole on update; notifications changes only the toggles sent, and only the toggles you declare are compared with what the API answers. Changing linearTeamId clears the status, project and label ids unless they are declared too. The Linear ids are easiest to pick once on the integration’s Configure page and read back with lookup.

Configuring a connected Linear integration

Section titled “Configuring a connected Linear integration”

File errors as Linear issues that resolve with the error

const errors = yield* BetterStack.Errors.Application("api-errors", {
platform: "bun_errors",
});
yield* BetterStack.Errors.LinearIntegration("linear", {
integrationId: "12345",
applications: [{ applicationId: errors.id, environments: ["production"] }],
linearTeamId: "9cfb482a-81e3-4154-b5b9-2c805e70a02d",
autoResolve: true,
autoReopen: true,
syncComments: true,
});

integrationId string required

The id of the Linear integration to take over: one connected in the Better Stack web app (Errors → Integrations → Linear), from List Linear integrations. Changing it takes over that integration instead; the previous one keeps its settings.

affectedUsersThresholdCount number

Total number of affected users for notifications.affected_users_threshold. A positive whole number.

applications UpdateErrorsLinearIntegrationRequestApplicationsItem[]

Applications this integration files issues for, each with its environments. Empty means any application. An update replaces the whole list.

autoReopen boolean

Reopen the Linear issue when its error is automatically re-opened, moving the issue back to linear_status_id. Works only when linear_status_id and linear_resolved_status_id are both set.

autoResolve boolean

Resolve the error when its Linear issue is done, and move the issue to linear_resolved_status_id when the error is resolved. Moving the issue works only when linear_resolved_status_id is set.

linearAssigneeId string | null

The ID of the Linear user new issues are assigned to. null clears it. Reads return an empty string when none is set.

linearLabelIds string[]

The IDs of the Linear labels added to new issues. An update replaces the whole list.

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

Priority of new issues.

linearProjectId string | null

The ID of the Linear project new issues are added to. null clears it. Reads return an empty string when none is set.

linearResolvedStatusId string | null

The ID of the Linear status an issue moves to when its error is resolved. null clears it. Reads return an empty string when none is set.

linearStatusId string | null

The ID of the Linear status new issues get. Empty means the Linear team's default status. null clears it. Reads return an empty string when none is set.

linearTeamId string | null

The ID of the Linear team issues are created in. To get the Linear IDs, pick them once on the integration's Configure page and read them back via Get a Linear integration. Changing the team clears linear_status_id, linear_resolved_status_id, linear_project_id and linear_label_ids unless the same request sets them. null clears it.

name string

Integration name.

notifications ErrorsLinearIntegrationNotifications

Which events file a Linear issue, as under Automatic issue creation in the web app. An update changes only the toggles sent.

occurrenceThresholdCount number

Number of occurrences for notifications.occurrence_threshold. A positive whole number.

occurrenceThresholdInterval "minute" | "hour" | "day" | "week" | string

Time window for notifications.occurrence_threshold.

syncComments boolean

Share comments between errors and their linked Linear issues.

tagFilter UpdateErrorsLinearIntegrationRequestTagFilterItem[]

The tags an error must have to get an issue. An error matches when one of its exceptions has every tag listed, each set to one of the tag's values. Empty means every error. You can list up to 10 tags, each once, with up to 50 values each. A tag or value can be up to 200 characters. An update replaces the whole list.

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 errors_linear_integration's id.

affectedUsersThresholdCount number

Total number of affected users for notifications.affected_users_threshold. A positive whole number.

applications UpdateErrorsLinearIntegrationRequestApplicationsItem[]

Applications whose errors this integration posts, each with its environments (ids as strings).

autoReopen boolean

Reopen the Linear issue when its error is automatically re-opened, moving the issue back to linear_status_id. Works only when linear_status_id and linear_resolved_status_id are both set.

autoResolve boolean

Resolve the error when its Linear issue is done, and move the issue to linear_resolved_status_id when the error is resolved. Moving the issue works only when linear_resolved_status_id is set.

linearAssigneeId string | null

The ID of the Linear user new issues are assigned to. null clears it. Reads return an empty string when none is set.

linearLabelIds string[]

The IDs of the Linear labels added to new issues. An update replaces the whole list.

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

Priority of new issues.

linearProjectId string | null

The ID of the Linear project new issues are added to. null clears it. Reads return an empty string when none is set.

linearResolvedStatusId string | null

The ID of the Linear status an issue moves to when its error is resolved. null clears it. Reads return an empty string when none is set.

linearStatusId string | null

The ID of the Linear status new issues get. Empty means the Linear team's default status. null clears it. Reads return an empty string when none is set.

linearTeamId string | null

The ID of the Linear team issues are created in. To get the Linear IDs, pick them once on the integration's Configure page and read them back via Get a Linear integration. Changing the team clears linear_status_id, linear_resolved_status_id, linear_project_id and linear_label_ids unless the same request sets them. null clears it.

name string

Integration name.

notifications ErrorsLinearIntegrationNotifications

Which events file a Linear issue, as under Automatic issue creation in the web app. An update changes only the toggles sent.

occurrenceThresholdCount number

Number of occurrences for notifications.occurrence_threshold. A positive whole number.

occurrenceThresholdInterval "minute" | "hour" | "day" | "week"

Time window for notifications.occurrence_threshold.

syncComments boolean

Share comments between errors and their linked Linear issues.

tagFilter ErrorsLinearIntegrationTagFilterItem[]

The tags an error must have to get an issue. An error matches when one of its exceptions has every tag listed, each set to one of the tag's values. Empty means every error. You can list up to 10 tags, each once, with up to 50 values each. A tag or value can be up to 200 characters. An update replaces the whole list.

teamId string

ID of the team that owns the integration, such as t123.

teamName string

Name of the team that owns the 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.