Documentation Index Fetch the complete documentation index at: https://trigger-v3-fix-additional-files.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Getting started
If you have not yet set up Trigger.dev in your project, go to the quick start guide .
Installation
To get started with the Linear integration on Trigger.dev, you need to install the @trigger.dev/linear package.
You can do this using npm, pnpm, or yarn:
npm install @trigger.dev/linear@latest
Authentication
To use the Linear API with Trigger.dev, you can either use OAuth or a Personal API Key.
OAuth
import { Linear } from "@trigger.dev/linear" ;
//this will use OAuth
const linear = new Linear ({
id: "linear" ,
});
Personal API Key
You can create a Personal API Key in your Linear API Settings .
import { Linear } from "@trigger.dev/linear" ;
//this will use the passed in API key (defined in your environment variables)
const linear = new Linear ({
id: "linear" ,
apiKey: process . env [ "LINEAR_API_KEY" ],
});
Usage
Include the Linear integration in your Trigger.dev job.
client . defineJob ({
id: "linear-new-issue-autoresponder" ,
name: "Linear - New Issue Autoresponder" ,
version: "0.1.0" ,
integrations: {
//use the linear integration
linear ,
},
//trigger on issue created events
trigger: linear . onIssueCreated (),
run : async ( payload , io , ctx ) => {
//get new issue ID from the event payload
const newIssueId = payload . data . id ;
//comment
await io . linear . createComment ( "create-comment" , {
issueId: newIssueId ,
body: "Thank's for opening this issue!" ,
});
//react
await io . linear . createReaction ( "create-reaction" , {
issueId: newIssueId ,
emoji: "+1" ,
});
//store and display in the job run
return { payload , ctx };
},
});
Serialization helper
Use the serializeLinearOutput helper instead of returning raw Linear SDK responses:
import { Linear , serializeLinearOutput } from "@trigger.dev/linear" ;
...
client . defineJob ({
id: "linear-sdk" ,
name: "Linear SDK" ,
version: "0.1.0" ,
integrations: {
linear ,
},
trigger: eventTrigger ({
name: "linear.sdk" ,
}),
run : async ( payload , io , ctx ) => {
//the official Linear SDK is exposed as `client`
const issues = await io . linear . runTask ( "first-two" , async ( client ) => {
//these nodes contain values we can't serialize, e.g. functions
const { nodes } = await client . issues ({ first: 2 });
//we remove them with this little helper
return serializeLinearOutput ( nodes );
});
return issues ;
},
});
You can paginate responses two different ways:
Iterating the same integration task with different params
Using the getAll helper exposed on the integration (recommended! )
When ordering results, make sure to use the PaginationOrderBy enum.
import { Linear , PaginationOrderBy , serializeLinearOutput } from "@trigger.dev/linear" ;
...
client . defineJob ({
id: "linear-pagination" ,
name: "Linear Pagination" ,
version: "0.1.0" ,
integrations: {
linear ,
},
trigger: eventTrigger ({
name: "linear.paginate" ,
}),
run : async ( payload , io , ctx ) => {
//the same params will be used for all tasks
const params = { first: 5 , orderBy: PaginationOrderBy . UpdatedAt };
//1. Linear integration - no pagination helper
let edges = await io . linear . issues ( "get-issues" , params );
let noHelper = edges . nodes ;
for ( let i = 0 ; edges . pageInfo . hasNextPage ; i ++ ) {
edges = await io . linear . issues ( `get-more-issues- ${ i } ` , {
... params ,
after: edges . pageInfo . endCursor ,
});
noHelper = noHelper . concat ( edges . nodes );
}
//2. Linear integration - with the pagination helper
const withHelper = await io . linear . getAll ( io . linear . issues , "get-all" , params );
return {
issueCounts: {
withSdk: sdkIssues . length ,
noHelper: noHelper . length ,
withHelper: withHelper . length ,
},
};
},
});
Triggers
Attachments
Function Name Description onAttachmentWhen any action is performed on an attachment. onAttachmentCreatedWhen an attachment is created. onAttachmentRemovedWhen an attachment is removed. onAttachmentUpdatedWhen an attachment is updated.
Function Name Description onCommentWhen any action is performed on an comment. onCommentCreatedWhen an comment is created. onCommentRemovedWhen an comment is removed. onCommentUpdatedWhen an comment is updated.
Cycles
Function Name Description onCycleWhen any action is performed on an cycle. onCycleCreatedWhen an cycle is created. onCycleRemovedWhen an cycle is removed. onCycleUpdatedWhen an cycle is updated.
Issues
Function Name Description onIssueWhen any action is performed on an issue. onIssueCreatedWhen an issue is created. onIssueRemovedWhen an issue is removed. onIssueUpdatedWhen an issue is updated.
Issue Labels
Function Name Description onIssueLabelWhen any action is performed on an issue label. onIssueLabelCreatedWhen an issue label is created. onIssueLabelRemovedWhen an issue label is removed. onIssueLabelUpdatedWhen an issue label is updated.
Issue SLAs
Function Name Description onIssueSLAWhen any action is performed on an issue SLA. onIssueSLASetWhen an issue SLA is set. onIssueSLABreachedWhen an issue SLA is breached. onIssueSLAHighRiskWhen an issue SLA is high risk.
Projects
Function Name Description onProjectWhen any action is performed on an project. onProjectCreatedWhen an project is created. onProjectRemovedWhen an project is removed. onProjectUpdatedWhen an project is updated.
Project Updates
Function Name Description onProjectUpdateWhen any action is performed on an project update. onProjectUpdateCreatedWhen an project update is created. onProjectUpdateRemovedWhen an project update is removed. onProjectUpdateUpdatedWhen an project update is updated.
Reactions
Function Name Description onReactionWhen any action is performed on an reaction. onReactionCreatedWhen an reaction is created. onReactionRemovedWhen an reaction is removed. onReactionUpdatedWhen an reaction is updated.
Tasks
Attachments
Function Name Description attachmentGets an attachment. attachmentsGets multiple attachments. createAttachmentCreates an attachment. deleteAttachmentDeletes an attachment. updateAttachmentUpdates an attachment.
Attachment Links
Function Name Description attachmentLinkFrontLinks a Front conversation to an issue. attachmentLinkIntercomLinks a Intercom conversation to an issue. attachmentLinkJiraIssueLinks a Jira issue to an issue. attachmentLinkSlackLinks a Slack message to an issue. attachmentLinkURLLinks any URL to an issue. attachmentLinkZendeskLinks a Zendesk ticket to an issue.
Function Name Description commentGets a comment. commentsGets multiple comments. createCommentCreates a comment. deleteCommentDeletes a comment. updateCommentUpdates a comment.
Cycles
Function Name Description archiveCycleArchives a cycle. createCycleCreates a cycle. updateCycleUpdates a cycle.
Documents
Function Name Description documentGets a document. documentsGets multiple documents. createDocumentCreates a document. searchDocumentsSearches documents.
Favorites
Function Name Description favoriteGets a favorite. favoritesGets multiple favorites. createFavoriteCreates a favorite.
Issues
Function Name Description issueGets an issue. issuesGets multiple issues. archiveIssueArchives an issue. createIssueCreates an issue. deleteIssueDeletes an issue. searchIssuesSearches issues. updateIssueUpdates an issue.
Issue Labels
Function Name Description issueLabelGets an issue label. issueLabelsGets multiple issue labels. createIssueLabelCreates an issue label. deleteIssueLabelDeletes an issue label. updateIssueLabelUpdates an issue label.
Issue Relations
Function Name Description issueRelationGets an issue relation. issueRelationsGets multiple issue relations. createIssueRelationCreates an issue relation.
Notifications
Function Name Description notificationGets a notification. notificationsGets multiple notifications. archiveNotificationArchives a notification. createNotificationSubscriptionCreates a notification subscription.
Organizations
Function Name Description organizationGets the viewer’s organization. createOrganizationFromOnboardingCreates an organization. createOrganizationInviteCreates an organization invite.
Projects
Function Name Description projectGets a project. projectsGets multiple projects. archiveProjectArchives a project. createProjectCreates a project. deleteProjectDeletes a project. searchProjectsSearches projects. updateProjectUpdates a project.
Project Links
Function Name Description projectLinkGets a project link. projectLinksGets multiple project links. createProjectLinkCreates a project link.
Project Updates
Function Name Description projectUpdateGets a project update. projectUpdatesGets multiple project updates. createProjectUpdateCreates a project update. deleteProjectUpdateDeletes a project update. updateProjectUpdateUpdates a project update.
Reactions
Function Name Description createReactionCreates a reaction. deleteReactionDeletes a reaction.
Roadmaps
Function Name Description archiveRoadmapArchives a roadmap. createRoadmapCreates a roadmap.
Teams
Function Name Description teamGets a team. teamsGets multiple teams. createTeamCreates a team.
Team Memberships
Function Name Description teamMembershipGets a team membership. teamMembershipsGets multiple team memberships. createTeamMembershipCreates a team membership.
Templates
Function Name Description templateGets a template. templatesGets multiple templates.
Users
Function Name Description userGets a user. usersGets multiple users. updateUserUpdates a user.
Webhooks
Function Name Description webhookGets a webhook. webhooksGets multiple webhooks. createWebhookCreates a webhook. deleteWebhookDeletes a webhook. updateWebhookUpdates a webhook.
Workflow States
Function Name Description workflowStateGets a workflow state. workflowStatesGets multiple workflow states. archiveWorkflowStateArchives a workflow state. createWorkflowStateCreates a workflow state.
Misc
Function Name Description createProjectMilestoneCreates a project milestone. issuePriorityValuesGets issue priority values and labels. viewerGets the currently authenticated user.
Example jobs
Code examples Check out pre-built jobs using Linear in our API section.