steps/linear
Read and update Linear issues outside workflow code.
Wrap steps in a factory-owned "use step" file. Never call them directly from a workflow.
Interfaces
CreateIssueInProjectInput
Fields used to create a Linear ticket in a project's first team.
Properties
| Property | Type |
|---|---|
description | string |
project | string |
title | string |
LinearIssueMatch
A matching Linear ticket returned by a project title search.
Properties
| Property | Type |
|---|---|
description | string |
id | string |
identifier | string |
state | string |
title | string |
url | string |
TicketStatusResult
The before-and-after state names from a ticket status update.
Properties
| Property | Type |
|---|---|
changed | boolean |
from | string |
to | string |
Type Aliases
NeedsHumanContext
type NeedsHumanContext = object;What the comment's footer says about the run that posted it. The factory's step wrapper builds it: the run id and the workflow name come from the Workflow SDK's metadata, and the dashboard link from the service's own configuration — none of it visible to the workflow. Where the run paused is the halt's, not the context's: only the routine that raised it knows.
Properties
| Property | Type |
|---|---|
dashboardUrl? | string |
runId | string |
workflow? | string |
RenderNeedsHumanComment()
type RenderNeedsHumanComment = (halt, context, participants) => string;Renders the Linear comment that asks a person to unblock a run.
Parameters
| Parameter | Type |
|---|---|
halt | Halt |
context | NeedsHumanContext |
participants | TicketParticipants |
Returns
string
RenderTicketNote()
type RenderTicketNote = (note, participants) => string;Renders a non-blocking Linear note for ticket participants.
Parameters
| Parameter | Type |
|---|---|
note | TicketNote |
participants | TicketParticipants |
Returns
string
TicketParticipants
type TicketParticipants = object;Who the comment greets. Either may be absent, and they are often the same.
Properties
| Property | Type |
|---|---|
assignee | LinearUser | null |
creator | LinearUser | null |
Variables
checkForTicketHumanReply
const checkForTicketHumanReply: CheckForTicketHumanReply;Look for a reply since the last check, excluding every comment the run posted.
renderNeedsHumanComment
const renderNeedsHumanComment: RenderNeedsHumanComment;Render the default human-input request as Linear Markdown.
renderTicketNote
const renderTicketNote: RenderTicketNote;Render the default non-blocking ticket note as Linear Markdown.
Functions
createComment()
function createComment(issueId, body): Promise<{
createdAt: string;
id: string;
}>;Post a comment on a ticket.
Parameters
| Parameter | Type |
|---|---|
issueId | string |
body | string |
Returns
Promise<{ createdAt: string; id: string; }>
createIssueInProject()
function createIssueInProject(input): Promise<{
id: string;
identifier: string;
url: string;
}>;Create a ticket in the project’s first team.
Parameters
| Parameter | Type |
|---|---|
input | CreateIssueInProjectInput |
Returns
Promise<{ id: string; identifier: string; url: string; }>
fetchTicketSnapshot()
function fetchTicketSnapshot(issueId): Promise<TicketSnapshot>;Read the ticket’s current details and discussion.
Parameters
| Parameter | Type |
|---|---|
issueId | string |
Returns
Promise<TicketSnapshot>
findIssueInProject()
function findIssueInProject(input): Promise<LinearIssueMatch | null>;Find the newest ticket in a project whose title starts with the given text.
Parameters
| Parameter | Type |
|---|---|
input | { project: string; titlePrefix: string; } |
input.project | string |
input.titlePrefix | string |
Returns
Promise<LinearIssueMatch | null>
postTicketHumanInputRequest()
function postTicketHumanInputRequest(
issueId,
halt,
metadata,
render): Promise<{
commentId: string;
postedAt: string;
}>;Post a question or failure on the ticket so a person can help the run continue.
Parameters
| Parameter | Type | Default value |
|---|---|---|
issueId | string | undefined |
halt | Halt | undefined |
metadata | NamedRunMetadata | undefined |
render | RenderNeedsHumanComment | renderNeedsHumanComment |
Returns
Promise<{ commentId: string; postedAt: string; }>
postTicketNote()
function postTicketNote(
issueId,
note,
render): Promise<{
commentId: string;
}>;Tell ticket participants something the run decided, without waiting for a reply.
Parameters
| Parameter | Type | Default value |
|---|---|---|
issueId | string | undefined |
note | TicketNote | undefined |
render | RenderTicketNote | renderTicketNote |
Returns
Promise<{ commentId: string; }>
resolveLinearIssue()
function resolveLinearIssue(reference): Promise<LinearIssueRef>;Resolve a Linear identifier or issue ID before claiming or reading the ticket.
Parameters
| Parameter | Type |
|---|---|
reference | string |
Returns
Promise<LinearIssueRef>
setTicketStatus()
function setTicketStatus(issueId, stateName): Promise<TicketStatusResult>;Set a ticket to one of its team's named states.
Parameters
| Parameter | Type |
|---|---|
issueId | string |
stateName | string |
Returns
Promise<TicketStatusResult>