Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 36 additions & 8 deletions apps/docs/content/docs/en/tools/linear.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,22 @@ Fetch and filter issues from Linear
| --------- | ---- | -------- | ----------- |
| `teamId` | string | No | Linear team ID to filter by |
| `projectId` | string | No | Linear project ID to filter by |
| `assigneeId` | string | No | User ID to filter by assignee |
| `stateId` | string | No | Workflow state ID to filter by status |
| `priority` | number | No | Priority to filter by \(0=No priority, 1=Urgent, 2=High, 3=Normal, 4=Low\) |
| `labelIds` | array | No | Array of label IDs to filter by |
| `createdAfter` | string | No | Filter issues created after this date \(ISO 8601 format\) |
| `updatedAfter` | string | No | Filter issues updated after this date \(ISO 8601 format\) |
| `includeArchived` | boolean | No | Include archived issues \(default: false\) |
| `first` | number | No | Number of issues to return \(default: 50, max: 250\) |
| `after` | string | No | Pagination cursor for next page |
| `orderBy` | string | No | Sort order: "createdAt" or "updatedAt" \(default: "updatedAt"\) |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `issues` | array | Array of issues from the specified Linear team and project, each containing id, title, description, state, teamId, and projectId |
| `issues` | array | Array of filtered issues from Linear |

### `linear_get_issue`

Expand Down Expand Up @@ -79,12 +89,22 @@ Create a new issue in Linear
| `projectId` | string | No | Linear project ID |
| `title` | string | Yes | Issue title |
| `description` | string | No | Issue description |
| `stateId` | string | No | Workflow state ID \(status\) |
| `assigneeId` | string | No | User ID to assign the issue to |
| `priority` | number | No | Priority \(0=No priority, 1=Urgent, 2=High, 3=Normal, 4=Low\) |
| `estimate` | number | No | Estimate in points |
| `labelIds` | array | No | Array of label IDs to set on the issue |
| `cycleId` | string | No | Cycle ID to assign the issue to |
| `parentId` | string | No | Parent issue ID \(for creating sub-issues\) |
| `dueDate` | string | No | Due date in ISO 8601 format \(date only: YYYY-MM-DD\) |
| `subscriberIds` | array | No | Array of user IDs to subscribe to the issue |
| `projectMilestoneId` | string | No | Project milestone ID to associate with the issue |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `issue` | object | The created issue containing id, title, description, state, teamId, and projectId |
| `issue` | object | The created issue with all its properties |

### `linear_update_issue`

Expand All @@ -101,7 +121,13 @@ Update an existing issue in Linear
| `assigneeId` | string | No | User ID to assign the issue to |
| `priority` | number | No | Priority \(0=No priority, 1=Urgent, 2=High, 3=Normal, 4=Low\) |
| `estimate` | number | No | Estimate in points |
| `labelIds` | array | No | Array of label IDs to set on the issue |
| `labelIds` | array | No | Array of label IDs to set on the issue \(replaces all existing labels\) |
| `projectId` | string | No | Project ID to move the issue to |
| `cycleId` | string | No | Cycle ID to assign the issue to |
| `parentId` | string | No | Parent issue ID \(for making this a sub-issue\) |
| `dueDate` | string | No | Due date in ISO 8601 format \(date only: YYYY-MM-DD\) |
| `addedLabelIds` | array | No | Array of label IDs to add to the issue \(without replacing existing labels\) |
| `removedLabelIds` | array | No | Array of label IDs to remove from the issue |

#### Output

Expand Down Expand Up @@ -352,9 +378,9 @@ Update an existing project in Linear
| `description` | string | No | New project description |
| `state` | string | No | Project state \(planned, started, completed, canceled\) |
| `leadId` | string | No | User ID of the project lead |
| `startDate` | string | No | Project start date \(ISO format\) |
| `targetDate` | string | No | Project target date \(ISO format\) |
| `priority` | number | No | Project priority \(0-4\) |
| `startDate` | string | No | Project start date \(ISO format: YYYY-MM-DD\) |
| `targetDate` | string | No | Project target date \(ISO format: YYYY-MM-DD\) |
| `priority` | number | No | Project priority \(0=No priority, 1=Urgent, 2=High, 3=Normal, 4=Low\) |

#### Output

Expand Down Expand Up @@ -530,7 +556,7 @@ Create a new workflow state (status) in Linear
| --------- | ---- | -------- | ----------- |
| `teamId` | string | Yes | Team ID to create the state in |
| `name` | string | Yes | State name \(e.g., "In Review"\) |
| `color` | string | Yes | State color \(hex format\) |
| `color` | string | No | State color \(hex format\) |
| `type` | string | Yes | State type: "backlog", "unstarted", "started", "completed", or "canceled" |
| `description` | string | No | State description |
| `position` | number | No | Position in the workflow |
Expand Down Expand Up @@ -711,7 +737,7 @@ Link two issues together in Linear (blocks, relates to, duplicates)
| --------- | ---- | -------- | ----------- |
| `issueId` | string | Yes | Source issue ID |
| `relatedIssueId` | string | Yes | Target issue ID to link to |
| `type` | string | Yes | Relation type: "blocks", "blocked", "duplicate", "related" |
| `type` | string | Yes | Relation type: "blocks", "duplicate", or "related". Note: When creating "blocks" from A to B, the inverse relation \(B blocked by A\) is automatically created. |

#### Output

Expand Down Expand Up @@ -1220,6 +1246,7 @@ Create a new project label in Linear

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `projectId` | string | Yes | The project for this label |
| `name` | string | Yes | Project label name |
| `color` | string | No | Label color \(hex code\) |
| `description` | string | No | Label description |
Expand Down Expand Up @@ -1397,6 +1424,7 @@ Create a new project status in Linear

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `projectId` | string | Yes | The project to create the status for |
| `name` | string | Yes | Project status name |
| `color` | string | Yes | Status color \(hex code\) |
| `description` | string | No | Status description |
Expand Down
6 changes: 3 additions & 3 deletions apps/sim/tools/linear/archive_label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const linearArchiveLabelTool: ToolConfig<
body: (params) => ({
query: `
mutation ArchiveLabel($id: String!) {
issueLabelDelete(id: $id) {
issueLabelArchive(id: $id) {
success
}
}
Expand All @@ -62,9 +62,9 @@ export const linearArchiveLabelTool: ToolConfig<
}

return {
success: data.data.issueLabelDelete.success,
success: data.data.issueLabelArchive.success,
output: {
success: data.data.issueLabelDelete.success,
success: data.data.issueLabelArchive.success,
labelId: params?.labelId,
},
}
Expand Down
158 changes: 153 additions & 5 deletions apps/sim/tools/linear/create_issue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,66 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
visibility: 'user-or-llm',
description: 'Issue description',
},
stateId: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Workflow state ID (status)',
},
assigneeId: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'User ID to assign the issue to',
},
priority: {
type: 'number',
required: false,
visibility: 'user-or-llm',
description: 'Priority (0=No priority, 1=Urgent, 2=High, 3=Normal, 4=Low)',
},
estimate: {
type: 'number',
required: false,
visibility: 'user-or-llm',
description: 'Estimate in points',
},
labelIds: {
type: 'array',
required: false,
visibility: 'user-or-llm',
description: 'Array of label IDs to set on the issue',
},
cycleId: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Cycle ID to assign the issue to',
},
parentId: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Parent issue ID (for creating sub-issues)',
},
dueDate: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Due date in ISO 8601 format (date only: YYYY-MM-DD)',
},
subscriberIds: {
type: 'array',
required: false,
visibility: 'user-or-llm',
description: 'Array of user IDs to subscribe to the issue',
},
projectMilestoneId: {
type: 'string',
required: false,
visibility: 'user-or-llm',
description: 'Project milestone ID to associate with the issue',
},
},

request: {
Expand Down Expand Up @@ -68,6 +128,36 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
if (params.description != null && params.description !== '') {
input.description = params.description
}
if (params.stateId != null && params.stateId !== '') {
input.stateId = params.stateId
}
if (params.assigneeId != null && params.assigneeId !== '') {
input.assigneeId = params.assigneeId
}
if (params.priority != null) {
input.priority = Number(params.priority)
}
if (params.estimate != null) {
input.estimate = Number(params.estimate)
}
if (params.labelIds != null && Array.isArray(params.labelIds)) {
input.labelIds = params.labelIds
}
if (params.cycleId != null && params.cycleId !== '') {
input.cycleId = params.cycleId
}
if (params.parentId != null && params.parentId !== '') {
input.parentId = params.parentId
}
if (params.dueDate != null && params.dueDate !== '') {
input.dueDate = params.dueDate
}
if (params.subscriberIds != null && Array.isArray(params.subscriberIds)) {
input.subscriberIds = params.subscriberIds
}
if (params.projectMilestoneId != null && params.projectMilestoneId !== '') {
input.projectMilestoneId = params.projectMilestoneId
}

return {
query: `
Expand All @@ -77,9 +167,42 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
id
title
description
state { name }
priority
estimate
url
dueDate
state {
id
name
type
}
assignee {
id
name
email
}
team { id }
project { id }
cycle {
id
number
name
}
parent {
id
title
}
projectMilestone {
id
name
}
labels {
nodes {
id
name
color
}
}
}
}
}
Expand Down Expand Up @@ -119,9 +242,22 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
id: issue.id,
title: issue.title,
description: issue.description,
state: issue.state?.name,
priority: issue.priority,
estimate: issue.estimate,
url: issue.url,
dueDate: issue.dueDate,
state: issue.state,
assignee: issue.assignee,
teamId: issue.team?.id,
projectId: issue.project?.id,
cycleId: issue.cycle?.id,
cycleNumber: issue.cycle?.number,
cycleName: issue.cycle?.name,
parentId: issue.parent?.id,
parentTitle: issue.parent?.title,
projectMilestoneId: issue.projectMilestone?.id,
projectMilestoneName: issue.projectMilestone?.name,
labels: issue.labels?.nodes || [],
},
},
}
Expand All @@ -130,15 +266,27 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
outputs: {
issue: {
type: 'object',
description:
'The created issue containing id, title, description, state, teamId, and projectId',
description: 'The created issue with all its properties',
properties: {
id: { type: 'string', description: 'Issue ID' },
title: { type: 'string', description: 'Issue title' },
description: { type: 'string', description: 'Issue description' },
state: { type: 'string', description: 'Issue state' },
priority: { type: 'number', description: 'Issue priority' },
estimate: { type: 'number', description: 'Issue estimate' },
url: { type: 'string', description: 'Issue URL' },
dueDate: { type: 'string', description: 'Due date (YYYY-MM-DD)' },
state: { type: 'object', description: 'Issue state' },
assignee: { type: 'object', description: 'Assigned user' },
teamId: { type: 'string', description: 'Team ID' },
projectId: { type: 'string', description: 'Project ID' },
cycleId: { type: 'string', description: 'Cycle ID' },
cycleNumber: { type: 'number', description: 'Cycle number' },
cycleName: { type: 'string', description: 'Cycle name' },
parentId: { type: 'string', description: 'Parent issue ID' },
parentTitle: { type: 'string', description: 'Parent issue title' },
projectMilestoneId: { type: 'string', description: 'Project milestone ID' },
projectMilestoneName: { type: 'string', description: 'Project milestone name' },
labels: { type: 'array', description: 'Issue labels' },
},
},
},
Expand Down
3 changes: 2 additions & 1 deletion apps/sim/tools/linear/create_issue_relation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export const linearCreateIssueRelationTool: ToolConfig<
type: 'string',
required: true,
visibility: 'user-or-llm',
description: 'Relation type: "blocks", "blocked", "duplicate", "related"',
description:
'Relation type: "blocks", "duplicate", or "related". Note: When creating "blocks" from A to B, the inverse relation (B blocked by A) is automatically created.',
},
},

Expand Down
7 changes: 7 additions & 0 deletions apps/sim/tools/linear/create_project_label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ export const linearCreateProjectLabelTool: ToolConfig<
},

params: {
projectId: {
type: 'string',
required: true,
visibility: 'user-only',
description: 'The project for this label',
},
name: {
type: 'string',
required: true,
Expand Down Expand Up @@ -65,6 +71,7 @@ export const linearCreateProjectLabelTool: ToolConfig<
},
body: (params) => {
const input: Record<string, any> = {
projectId: params.projectId,
name: params.name,
}

Expand Down
7 changes: 7 additions & 0 deletions apps/sim/tools/linear/create_project_status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ export const linearCreateProjectStatusTool: ToolConfig<
},

params: {
projectId: {
type: 'string',
required: true,
visibility: 'user-only',
description: 'The project to create the status for',
},
name: {
type: 'string',
required: true,
Expand Down Expand Up @@ -65,6 +71,7 @@ export const linearCreateProjectStatusTool: ToolConfig<
},
body: (params) => {
const input: Record<string, any> = {
projectId: params.projectId,
name: params.name,
color: params.color,
}
Expand Down
Loading