Skip to content

Commit 8cebd7c

Browse files
committed
fix(linear): fix remaining ops
1 parent 768cdec commit 8cebd7c

File tree

12 files changed

+526
-48
lines changed

12 files changed

+526
-48
lines changed

apps/docs/content/docs/en/tools/linear.mdx

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,22 @@ Fetch and filter issues from Linear
4444
| --------- | ---- | -------- | ----------- |
4545
| `teamId` | string | No | Linear team ID to filter by |
4646
| `projectId` | string | No | Linear project ID to filter by |
47+
| `assigneeId` | string | No | User ID to filter by assignee |
48+
| `stateId` | string | No | Workflow state ID to filter by status |
49+
| `priority` | number | No | Priority to filter by \(0=No priority, 1=Urgent, 2=High, 3=Normal, 4=Low\) |
50+
| `labelIds` | array | No | Array of label IDs to filter by |
51+
| `createdAfter` | string | No | Filter issues created after this date \(ISO 8601 format\) |
52+
| `updatedAfter` | string | No | Filter issues updated after this date \(ISO 8601 format\) |
53+
| `includeArchived` | boolean | No | Include archived issues \(default: false\) |
54+
| `first` | number | No | Number of issues to return \(default: 50, max: 250\) |
55+
| `after` | string | No | Pagination cursor for next page |
56+
| `orderBy` | string | No | Sort order: "createdAt" or "updatedAt" \(default: "updatedAt"\) |
4757

4858
#### Output
4959

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

5464
### `linear_get_issue`
5565

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

83103
#### Output
84104

85105
| Parameter | Type | Description |
86106
| --------- | ---- | ----------- |
87-
| `issue` | object | The created issue containing id, title, description, state, teamId, and projectId |
107+
| `issue` | object | The created issue with all its properties |
88108

89109
### `linear_update_issue`
90110

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

106132
#### Output
107133

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

359385
#### Output
360386

@@ -530,7 +556,7 @@ Create a new workflow state (status) in Linear
530556
| --------- | ---- | -------- | ----------- |
531557
| `teamId` | string | Yes | Team ID to create the state in |
532558
| `name` | string | Yes | State name \(e.g., "In Review"\) |
533-
| `color` | string | Yes | State color \(hex format\) |
559+
| `color` | string | No | State color \(hex format\) |
534560
| `type` | string | Yes | State type: "backlog", "unstarted", "started", "completed", or "canceled" |
535561
| `description` | string | No | State description |
536562
| `position` | number | No | Position in the workflow |
@@ -711,7 +737,7 @@ Link two issues together in Linear (blocks, relates to, duplicates)
711737
| --------- | ---- | -------- | ----------- |
712738
| `issueId` | string | Yes | Source issue ID |
713739
| `relatedIssueId` | string | Yes | Target issue ID to link to |
714-
| `type` | string | Yes | Relation type: "blocks", "blocked", "duplicate", "related" |
740+
| `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. |
715741

716742
#### Output
717743

@@ -1220,6 +1246,7 @@ Create a new project label in Linear
12201246

12211247
| Parameter | Type | Required | Description |
12221248
| --------- | ---- | -------- | ----------- |
1249+
| `projectId` | string | Yes | The project for this label |
12231250
| `name` | string | Yes | Project label name |
12241251
| `color` | string | No | Label color \(hex code\) |
12251252
| `description` | string | No | Label description |
@@ -1397,6 +1424,7 @@ Create a new project status in Linear
13971424

13981425
| Parameter | Type | Required | Description |
13991426
| --------- | ---- | -------- | ----------- |
1427+
| `projectId` | string | Yes | The project to create the status for |
14001428
| `name` | string | Yes | Project status name |
14011429
| `color` | string | Yes | Status color \(hex code\) |
14021430
| `description` | string | No | Status description |

apps/sim/tools/linear/archive_label.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const linearArchiveLabelTool: ToolConfig<
3939
body: (params) => ({
4040
query: `
4141
mutation ArchiveLabel($id: String!) {
42-
issueLabelDelete(id: $id) {
42+
issueLabelArchive(id: $id) {
4343
success
4444
}
4545
}
@@ -62,9 +62,9 @@ export const linearArchiveLabelTool: ToolConfig<
6262
}
6363

6464
return {
65-
success: data.data.issueLabelDelete.success,
65+
success: data.data.issueLabelArchive.success,
6666
output: {
67-
success: data.data.issueLabelDelete.success,
67+
success: data.data.issueLabelArchive.success,
6868
labelId: params?.labelId,
6969
},
7070
}

apps/sim/tools/linear/create_issue.ts

Lines changed: 153 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,66 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
3838
visibility: 'user-or-llm',
3939
description: 'Issue description',
4040
},
41+
stateId: {
42+
type: 'string',
43+
required: false,
44+
visibility: 'user-or-llm',
45+
description: 'Workflow state ID (status)',
46+
},
47+
assigneeId: {
48+
type: 'string',
49+
required: false,
50+
visibility: 'user-or-llm',
51+
description: 'User ID to assign the issue to',
52+
},
53+
priority: {
54+
type: 'number',
55+
required: false,
56+
visibility: 'user-or-llm',
57+
description: 'Priority (0=No priority, 1=Urgent, 2=High, 3=Normal, 4=Low)',
58+
},
59+
estimate: {
60+
type: 'number',
61+
required: false,
62+
visibility: 'user-or-llm',
63+
description: 'Estimate in points',
64+
},
65+
labelIds: {
66+
type: 'array',
67+
required: false,
68+
visibility: 'user-or-llm',
69+
description: 'Array of label IDs to set on the issue',
70+
},
71+
cycleId: {
72+
type: 'string',
73+
required: false,
74+
visibility: 'user-or-llm',
75+
description: 'Cycle ID to assign the issue to',
76+
},
77+
parentId: {
78+
type: 'string',
79+
required: false,
80+
visibility: 'user-or-llm',
81+
description: 'Parent issue ID (for creating sub-issues)',
82+
},
83+
dueDate: {
84+
type: 'string',
85+
required: false,
86+
visibility: 'user-or-llm',
87+
description: 'Due date in ISO 8601 format (date only: YYYY-MM-DD)',
88+
},
89+
subscriberIds: {
90+
type: 'array',
91+
required: false,
92+
visibility: 'user-or-llm',
93+
description: 'Array of user IDs to subscribe to the issue',
94+
},
95+
projectMilestoneId: {
96+
type: 'string',
97+
required: false,
98+
visibility: 'user-or-llm',
99+
description: 'Project milestone ID to associate with the issue',
100+
},
41101
},
42102

43103
request: {
@@ -68,6 +128,36 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
68128
if (params.description != null && params.description !== '') {
69129
input.description = params.description
70130
}
131+
if (params.stateId != null && params.stateId !== '') {
132+
input.stateId = params.stateId
133+
}
134+
if (params.assigneeId != null && params.assigneeId !== '') {
135+
input.assigneeId = params.assigneeId
136+
}
137+
if (params.priority != null) {
138+
input.priority = Number(params.priority)
139+
}
140+
if (params.estimate != null) {
141+
input.estimate = Number(params.estimate)
142+
}
143+
if (params.labelIds != null && Array.isArray(params.labelIds)) {
144+
input.labelIds = params.labelIds
145+
}
146+
if (params.cycleId != null && params.cycleId !== '') {
147+
input.cycleId = params.cycleId
148+
}
149+
if (params.parentId != null && params.parentId !== '') {
150+
input.parentId = params.parentId
151+
}
152+
if (params.dueDate != null && params.dueDate !== '') {
153+
input.dueDate = params.dueDate
154+
}
155+
if (params.subscriberIds != null && Array.isArray(params.subscriberIds)) {
156+
input.subscriberIds = params.subscriberIds
157+
}
158+
if (params.projectMilestoneId != null && params.projectMilestoneId !== '') {
159+
input.projectMilestoneId = params.projectMilestoneId
160+
}
71161

72162
return {
73163
query: `
@@ -77,9 +167,42 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
77167
id
78168
title
79169
description
80-
state { name }
170+
priority
171+
estimate
172+
url
173+
dueDate
174+
state {
175+
id
176+
name
177+
type
178+
}
179+
assignee {
180+
id
181+
name
182+
email
183+
}
81184
team { id }
82185
project { id }
186+
cycle {
187+
id
188+
number
189+
name
190+
}
191+
parent {
192+
id
193+
title
194+
}
195+
projectMilestone {
196+
id
197+
name
198+
}
199+
labels {
200+
nodes {
201+
id
202+
name
203+
color
204+
}
205+
}
83206
}
84207
}
85208
}
@@ -119,9 +242,22 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
119242
id: issue.id,
120243
title: issue.title,
121244
description: issue.description,
122-
state: issue.state?.name,
245+
priority: issue.priority,
246+
estimate: issue.estimate,
247+
url: issue.url,
248+
dueDate: issue.dueDate,
249+
state: issue.state,
250+
assignee: issue.assignee,
123251
teamId: issue.team?.id,
124252
projectId: issue.project?.id,
253+
cycleId: issue.cycle?.id,
254+
cycleNumber: issue.cycle?.number,
255+
cycleName: issue.cycle?.name,
256+
parentId: issue.parent?.id,
257+
parentTitle: issue.parent?.title,
258+
projectMilestoneId: issue.projectMilestone?.id,
259+
projectMilestoneName: issue.projectMilestone?.name,
260+
labels: issue.labels?.nodes || [],
125261
},
126262
},
127263
}
@@ -130,15 +266,27 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
130266
outputs: {
131267
issue: {
132268
type: 'object',
133-
description:
134-
'The created issue containing id, title, description, state, teamId, and projectId',
269+
description: 'The created issue with all its properties',
135270
properties: {
136271
id: { type: 'string', description: 'Issue ID' },
137272
title: { type: 'string', description: 'Issue title' },
138273
description: { type: 'string', description: 'Issue description' },
139-
state: { type: 'string', description: 'Issue state' },
274+
priority: { type: 'number', description: 'Issue priority' },
275+
estimate: { type: 'number', description: 'Issue estimate' },
276+
url: { type: 'string', description: 'Issue URL' },
277+
dueDate: { type: 'string', description: 'Due date (YYYY-MM-DD)' },
278+
state: { type: 'object', description: 'Issue state' },
279+
assignee: { type: 'object', description: 'Assigned user' },
140280
teamId: { type: 'string', description: 'Team ID' },
141281
projectId: { type: 'string', description: 'Project ID' },
282+
cycleId: { type: 'string', description: 'Cycle ID' },
283+
cycleNumber: { type: 'number', description: 'Cycle number' },
284+
cycleName: { type: 'string', description: 'Cycle name' },
285+
parentId: { type: 'string', description: 'Parent issue ID' },
286+
parentTitle: { type: 'string', description: 'Parent issue title' },
287+
projectMilestoneId: { type: 'string', description: 'Project milestone ID' },
288+
projectMilestoneName: { type: 'string', description: 'Project milestone name' },
289+
labels: { type: 'array', description: 'Issue labels' },
142290
},
143291
},
144292
},

apps/sim/tools/linear/create_issue_relation.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export const linearCreateIssueRelationTool: ToolConfig<
3535
type: 'string',
3636
required: true,
3737
visibility: 'user-or-llm',
38-
description: 'Relation type: "blocks", "blocked", "duplicate", "related"',
38+
description:
39+
'Relation type: "blocks", "duplicate", or "related". Note: When creating "blocks" from A to B, the inverse relation (B blocked by A) is automatically created.',
3940
},
4041
},
4142

apps/sim/tools/linear/create_project_label.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ export const linearCreateProjectLabelTool: ToolConfig<
1919
},
2020

2121
params: {
22+
projectId: {
23+
type: 'string',
24+
required: true,
25+
visibility: 'user-only',
26+
description: 'The project for this label',
27+
},
2228
name: {
2329
type: 'string',
2430
required: true,
@@ -65,6 +71,7 @@ export const linearCreateProjectLabelTool: ToolConfig<
6571
},
6672
body: (params) => {
6773
const input: Record<string, any> = {
74+
projectId: params.projectId,
6875
name: params.name,
6976
}
7077

apps/sim/tools/linear/create_project_status.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ export const linearCreateProjectStatusTool: ToolConfig<
1919
},
2020

2121
params: {
22+
projectId: {
23+
type: 'string',
24+
required: true,
25+
visibility: 'user-only',
26+
description: 'The project to create the status for',
27+
},
2228
name: {
2329
type: 'string',
2430
required: true,
@@ -65,6 +71,7 @@ export const linearCreateProjectStatusTool: ToolConfig<
6571
},
6672
body: (params) => {
6773
const input: Record<string, any> = {
74+
projectId: params.projectId,
6875
name: params.name,
6976
color: params.color,
7077
}

0 commit comments

Comments
 (0)