Skip to content

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 ​

PropertyType
descriptionstring
projectstring
titlestring

LinearIssueMatch ​

A matching Linear ticket returned by a project title search.

Properties ​

PropertyType
descriptionstring
idstring
identifierstring
statestring
titlestring
urlstring

TicketStatusResult ​

The before-and-after state names from a ticket status update.

Properties ​

PropertyType
changedboolean
fromstring
tostring

Type Aliases ​

NeedsHumanContext ​

ts
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 ​

PropertyType
dashboardUrl?string
runIdstring
workflow?string

RenderNeedsHumanComment() ​

ts
type RenderNeedsHumanComment = (halt, context, participants) => string;

Renders the Linear comment that asks a person to unblock a run.

Parameters ​

ParameterType
haltHalt
contextNeedsHumanContext
participantsTicketParticipants

Returns ​

string


RenderTicketNote() ​

ts
type RenderTicketNote = (note, participants) => string;

Renders a non-blocking Linear note for ticket participants.

Parameters ​

ParameterType
noteTicketNote
participantsTicketParticipants

Returns ​

string


TicketParticipants ​

ts
type TicketParticipants = object;

Who the comment greets. Either may be absent, and they are often the same.

Properties ​

PropertyType
assigneeLinearUser | null
creatorLinearUser | null

Variables ​

checkForTicketHumanReply ​

ts
const checkForTicketHumanReply: CheckForTicketHumanReply;

Look for a reply since the last check, excluding every comment the run posted.


renderNeedsHumanComment ​

ts
const renderNeedsHumanComment: RenderNeedsHumanComment;

Render the default human-input request as Linear Markdown.


renderTicketNote ​

ts
const renderTicketNote: RenderTicketNote;

Render the default non-blocking ticket note as Linear Markdown.

Functions ​

createComment() ​

ts
function createComment(issueId, body): Promise<{
  createdAt: string;
  id: string;
}>;

Post a comment on a ticket.

Parameters ​

ParameterType
issueIdstring
bodystring

Returns ​

Promise<{ createdAt: string; id: string; }>


createIssueInProject() ​

ts
function createIssueInProject(input): Promise<{
  id: string;
  identifier: string;
  url: string;
}>;

Create a ticket in the project’s first team.

Parameters ​

ParameterType
inputCreateIssueInProjectInput

Returns ​

Promise<{ id: string; identifier: string; url: string; }>


fetchTicketSnapshot() ​

ts
function fetchTicketSnapshot(issueId): Promise<TicketSnapshot>;

Read the ticket’s current details and discussion.

Parameters ​

ParameterType
issueIdstring

Returns ​

Promise<TicketSnapshot>


findIssueInProject() ​

ts
function findIssueInProject(input): Promise<LinearIssueMatch | null>;

Find the newest ticket in a project whose title starts with the given text.

Parameters ​

ParameterType
input{ project: string; titlePrefix: string; }
input.projectstring
input.titlePrefixstring

Returns ​

Promise<LinearIssueMatch | null>


postTicketHumanInputRequest() ​

ts
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 ​

ParameterTypeDefault value
issueIdstringundefined
haltHaltundefined
metadataNamedRunMetadataundefined
renderRenderNeedsHumanCommentrenderNeedsHumanComment

Returns ​

Promise<{ commentId: string; postedAt: string; }>


postTicketNote() ​

ts
function postTicketNote(
   issueId, 
   note, 
   render): Promise<{
  commentId: string;
}>;

Tell ticket participants something the run decided, without waiting for a reply.

Parameters ​

ParameterTypeDefault value
issueIdstringundefined
noteTicketNoteundefined
renderRenderTicketNoterenderTicketNote

Returns ​

Promise<{ commentId: string; }>


resolveLinearIssue() ​

ts
function resolveLinearIssue(reference): Promise<LinearIssueRef>;

Resolve a Linear identifier or issue ID before claiming or reading the ticket.

Parameters ​

ParameterType
referencestring

Returns ​

Promise<LinearIssueRef>


setTicketStatus() ​

ts
function setTicketStatus(issueId, stateName): Promise<TicketStatusResult>;

Set a ticket to one of its team's named states.

Parameters ​

ParameterType
issueIdstring
stateNamestring

Returns ​

Promise<TicketStatusResult>

Released under the MIT License.