When someone asks for help in your Slack channel, opens a Linear ticket with a written summary and replies in the thread with the link.
Uses
ClaudeLinear
Slack
Turn Slack support requests into Linear tickets
request.When someone posts in a channel. Save it as request.linearTeamName to blank.Set linearTeamName to blank.requestText to blank.Set requestText to blank.textErrorIf a step below fails, save the error as textErrorTry
request.text and save it as requestText.Trim request.text and save it as requestText.On error
No steps
requestText is emptyIf requestText is emptyYes
No
No steps
linearTeams.List all active Linear teams. Save it as linearTeams.linearTeamId to blank.Set linearTeamId to blank.teamsSeen to an empty list.Set teamsSeen to an empty list.team in linearTeams.teams:For each team in linearTeams.teams:teamErrorIf a step below fails, save the error as teamErrorTry
team.name and save it as teamName.Trim team.name and save it as teamName.team.key and save it as teamKey.Trim team.key and save it as teamKey.teamName (teamKey) to the end of teamsSeen and save it as teamsSeen.Add teamName (teamKey) to the end of teamsSeen and save it as teamsSeen.linearTeamId is empty and teamName in lowercase is linearTeamName in…If linearTeamId is empty and teamName in lowercase is linearTeamName in…Yes
team.id and save it as linearTeamId.Trim team.id and save it as linearTeamId.No
No steps
On error
teamError as text.Show in the output: Skipped a Linear team that was missing its name, key or id: teamError as text.linearTeamId is emptyIf linearTeamId is emptyYes
teamsSeen joined by , .Stop and report a problem: No Linear team is called '@linearTeamName'. Set 'linearTeamName' to a team name or key exactly as Linear spells it. Teams this connection can see: teamsSeen joined by , .No
No steps
requestText'. Save it as triageResponse.
Maximum response length: 8verdict to blank.Set verdict to blank.verdictErrorIf a step below fails, save the error as verdictErrorTry
triageResponse.response_text and save it as verdict.Trim triageResponse.response_text and save it as verdict.On error
verdictError as text.Show in the output: Could not read the triage answer, so no ticket was opened: verdictError as text.verdict starts with urgent (ignoring case) and save it as isUrgent.Check whether verdict starts with urgent (ignoring case) and save it as isUrgent.opensTicket to isUrgent or verdict starts with request (ignoring case).Set opensTicket to isUrgent or verdict starts with request (ignoring case).opensTicket is noIf opensTicket is noYes
No
No steps
ticketPriority to 3.Set ticketPriority to 3.isUrgent is yesIf isUrgent is yesYes
ticketPriority to 2.Change ticketPriority to 2.No
No steps
requestText'. Save it as titleResponse.
Maximum response length: 60ticketTitle to Support request from Slack.Set ticketTitle to Support request from Slack.titleErrorIf a step below fails, save the error as titleErrorTry
titleResponse.response_text and save it as draftTitle.Trim titleResponse.response_text and save it as draftTitle.draftTitle isn't emptyIf draftTitle isn't emptyYes
draftTitle to 120 characters and save it as ticketTitle.Shorten draftTitle to 120 characters and save it as ticketTitle.No
No steps
On error
titleError as text.Show in the output: Could not read the ticket title, so a default one was used: titleError as text.requestText'. Save it as bodyResponse.
Maximum response length: 600ticketBody to requestText.Set ticketBody to requestText.bodyErrorIf a step below fails, save the error as bodyErrorTry
bodyResponse.response_text and save it as draftBody.Trim bodyResponse.response_text and save it as draftBody.draftBody isn't emptyIf draftBody isn't emptyYes
ticketBody to draftBody.Change ticketBody to draftBody.No
No steps
On error
bodyError as text.Show in the output: Could not read the ticket summary, so the original message was used instead: bodyError as text.reporterName to a teammate.Set reporterName to a teammate.reporterErrorIf a step below fails, save the error as reporterErrorTry
request.user_id. Save it as reporterProfile.Get the details of request.user_id. Save it as reporterProfile.reporterProfile.user.real_name and save it as reporterRealName.Trim reporterProfile.user.real_name and save it as reporterRealName.reporterRealName isn't emptyIf reporterRealName isn't emptyYes
reporterName to reporterRealName.Change reporterName to reporterRealName.No
No steps
On error
reporterError as text.Show in the output: Could not look up who posted the message: reporterError as text.linearTeamId in team ticketTitle. Save it as ticket.Create an issue titled linearTeamId in team ticketTitle. Save it as ticket.
Priority: ticketPriorityticketBody
---
Reported in Slack by reporterName. Their message is quoted word for word in the first comment on this ticket.commentErrorIf a step below fails, save the error as commentErrorTry
ticket.issue.id.Add a comment to Linear issue ticket.issue.id.Posted in Slack by reporterName:
requestTextOn error
commentError as text.Show in the output: The ticket was created but the original message could not be added as a comment: commentError as text.ticketRef to blank.Set ticketRef to blank.ticketUrl to blank.Set ticketUrl to blank.ticketReadErrorIf a step below fails, save the error as ticketReadErrorTry
ticket.issue.identifier and save it as ticketRef.Trim ticket.issue.identifier and save it as ticketRef.ticket.issue.url and save it as ticketUrl.Trim ticket.issue.url and save it as ticketUrl.On error
ticketReadError as text.Show in the output: The ticket was created but its reference could not be read: ticketReadError as text.request.channel_id.Reply in a thread in request.channel_id.
Reply To: request.message_tsThanks - this is now tracked as ticketRef.
ticketTitle
ticketUrl
This reply was posted automatically. Anything else that would help is best added to the ticket, because replies in this thread do not reach it on their own.