Skip to content

Commit 6b28742

Browse files
authored
fix(linear): missing params (#2740)
* added missing params * fixed linear bugs
1 parent e5c9509 commit 6b28742

File tree

7 files changed

+62
-196
lines changed

7 files changed

+62
-196
lines changed

apps/sim/blocks/blocks/linear.ts

Lines changed: 46 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
7777
// Project Update Operations
7878
{ label: 'Create Project Update', id: 'linear_create_project_update' },
7979
{ label: 'List Project Updates', id: 'linear_list_project_updates' },
80-
{ label: 'Create Project Link', id: 'linear_create_project_link' },
8180
// Notification Operations
8281
{ label: 'List Notifications', id: 'linear_list_notifications' },
8382
{ label: 'Update Notification', id: 'linear_update_notification' },
@@ -227,6 +226,7 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
227226
'linear_update_project',
228227
'linear_archive_project',
229228
'linear_delete_project',
229+
'linear_create_project_update',
230230
'linear_list_project_updates',
231231
],
232232
},
@@ -239,6 +239,7 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
239239
'linear_update_project',
240240
'linear_archive_project',
241241
'linear_delete_project',
242+
'linear_create_project_update',
242243
'linear_list_project_updates',
243244
'linear_list_project_labels',
244245
],
@@ -261,7 +262,6 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
261262
'linear_delete_project',
262263
'linear_create_project_update',
263264
'linear_list_project_updates',
264-
'linear_create_project_link',
265265
],
266266
},
267267
condition: {
@@ -275,7 +275,6 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
275275
'linear_delete_project',
276276
'linear_create_project_update',
277277
'linear_list_project_updates',
278-
'linear_create_project_link',
279278
'linear_list_project_labels',
280279
],
281280
},
@@ -625,7 +624,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
625624
required: true,
626625
condition: {
627626
field: 'operation',
628-
value: ['linear_create_attachment', 'linear_create_project_link'],
627+
value: ['linear_create_attachment'],
629628
},
630629
},
631630
// Attachment title
@@ -1221,6 +1220,36 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
12211220
value: ['linear_create_project_status'],
12221221
},
12231222
},
1223+
{
1224+
id: 'projectStatusType',
1225+
title: 'Status Type',
1226+
type: 'dropdown',
1227+
options: [
1228+
{ label: 'Backlog', id: 'backlog' },
1229+
{ label: 'Planned', id: 'planned' },
1230+
{ label: 'Started', id: 'started' },
1231+
{ label: 'Paused', id: 'paused' },
1232+
{ label: 'Completed', id: 'completed' },
1233+
{ label: 'Canceled', id: 'canceled' },
1234+
],
1235+
value: () => 'started',
1236+
required: true,
1237+
condition: {
1238+
field: 'operation',
1239+
value: ['linear_create_project_status'],
1240+
},
1241+
},
1242+
{
1243+
id: 'projectStatusPosition',
1244+
title: 'Position',
1245+
type: 'short-input',
1246+
placeholder: 'Enter position (e.g. 0, 1, 2...)',
1247+
required: true,
1248+
condition: {
1249+
field: 'operation',
1250+
value: ['linear_create_project_status'],
1251+
},
1252+
},
12241253
{
12251254
id: 'projectStatusId',
12261255
title: 'Status ID',
@@ -1326,7 +1355,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
13261355
'linear_list_favorites',
13271356
'linear_create_project_update',
13281357
'linear_list_project_updates',
1329-
'linear_create_project_link',
13301358
'linear_list_notifications',
13311359
'linear_update_notification',
13321360
'linear_create_customer',
@@ -1772,17 +1800,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
17721800
projectId: effectiveProjectId,
17731801
}
17741802

1775-
case 'linear_create_project_link':
1776-
if (!effectiveProjectId || !params.url?.trim()) {
1777-
throw new Error('Project ID and URL are required.')
1778-
}
1779-
return {
1780-
...baseParams,
1781-
projectId: effectiveProjectId,
1782-
url: params.url.trim(),
1783-
label: params.name,
1784-
}
1785-
17861803
case 'linear_list_notifications':
17871804
return baseParams
17881805

@@ -2033,22 +2050,22 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
20332050
}
20342051

20352052
case 'linear_add_label_to_project':
2036-
if (!effectiveProjectId || !params.projectLabelId?.trim()) {
2053+
if (!params.projectIdForMilestone?.trim() || !params.projectLabelId?.trim()) {
20372054
throw new Error('Project ID and label ID are required.')
20382055
}
20392056
return {
20402057
...baseParams,
2041-
projectId: effectiveProjectId,
2058+
projectId: params.projectIdForMilestone.trim(),
20422059
labelId: params.projectLabelId.trim(),
20432060
}
20442061

20452062
case 'linear_remove_label_from_project':
2046-
if (!effectiveProjectId || !params.projectLabelId?.trim()) {
2063+
if (!params.projectIdForMilestone?.trim() || !params.projectLabelId?.trim()) {
20472064
throw new Error('Project ID and label ID are required.')
20482065
}
20492066
return {
20502067
...baseParams,
2051-
projectId: effectiveProjectId,
2068+
projectId: params.projectIdForMilestone.trim(),
20522069
labelId: params.projectLabelId.trim(),
20532070
}
20542071

@@ -2097,13 +2114,20 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
20972114

20982115
// Project Status Operations
20992116
case 'linear_create_project_status':
2100-
if (!params.projectStatusName?.trim() || !params.statusColor?.trim()) {
2101-
throw new Error('Project status name and color are required.')
2117+
if (
2118+
!params.projectStatusName?.trim() ||
2119+
!params.projectStatusType?.trim() ||
2120+
!params.statusColor?.trim() ||
2121+
!params.projectStatusPosition?.trim()
2122+
) {
2123+
throw new Error('Project status name, type, color, and position are required.')
21022124
}
21032125
return {
21042126
...baseParams,
21052127
name: params.projectStatusName.trim(),
2128+
type: params.projectStatusType.trim(),
21062129
color: params.statusColor.trim(),
2130+
position: Number.parseFloat(params.projectStatusPosition.trim()),
21072131
description: params.projectStatusDescription?.trim() || undefined,
21082132
indefinite: params.projectStatusIndefinite === 'true',
21092133
}
@@ -2270,7 +2294,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n
22702294
// Project update outputs
22712295
update: { type: 'json', description: 'Project update data' },
22722296
updates: { type: 'json', description: 'Project updates list' },
2273-
link: { type: 'json', description: 'Project link data' },
22742297
// Notification outputs
22752298
notification: { type: 'json', description: 'Notification data' },
22762299
notifications: { type: 'json', description: 'Notifications list' },

apps/sim/tools/linear/create_project_label.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ 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-
},
2822
name: {
2923
type: 'string',
3024
required: true,
@@ -71,7 +65,6 @@ export const linearCreateProjectLabelTool: ToolConfig<
7165
},
7266
body: (params) => {
7367
const input: Record<string, any> = {
74-
projectId: params.projectId,
7568
name: params.name,
7669
}
7770

apps/sim/tools/linear/create_project_link.ts

Lines changed: 0 additions & 123 deletions
This file was deleted.

apps/sim/tools/linear/create_project_status.ts

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,31 @@ export const linearCreateProjectStatusTool: ToolConfig<
1919
},
2020

2121
params: {
22-
projectId: {
22+
name: {
2323
type: 'string',
2424
required: true,
25-
visibility: 'user-only',
26-
description: 'The project to create the status for',
25+
visibility: 'user-or-llm',
26+
description: 'Project status name',
2727
},
28-
name: {
28+
type: {
2929
type: 'string',
3030
required: true,
3131
visibility: 'user-or-llm',
32-
description: 'Project status name',
32+
description:
33+
'Status type: "backlog", "planned", "started", "paused", "completed", or "canceled"',
3334
},
3435
color: {
3536
type: 'string',
3637
required: true,
3738
visibility: 'user-or-llm',
3839
description: 'Status color (hex code)',
3940
},
41+
position: {
42+
type: 'number',
43+
required: true,
44+
visibility: 'user-or-llm',
45+
description: 'Position in status list (e.g. 0, 1, 2...)',
46+
},
4047
description: {
4148
type: 'string',
4249
required: false,
@@ -49,12 +56,6 @@ export const linearCreateProjectStatusTool: ToolConfig<
4956
visibility: 'user-or-llm',
5057
description: 'Whether the status is indefinite',
5158
},
52-
position: {
53-
type: 'number',
54-
required: false,
55-
visibility: 'user-or-llm',
56-
description: 'Position in status list',
57-
},
5859
},
5960

6061
request: {
@@ -71,9 +72,10 @@ export const linearCreateProjectStatusTool: ToolConfig<
7172
},
7273
body: (params) => {
7374
const input: Record<string, any> = {
74-
projectId: params.projectId,
7575
name: params.name,
76+
type: params.type,
7677
color: params.color,
78+
position: params.position,
7779
}
7880

7981
if (params.description != null && params.description !== '') {
@@ -82,9 +84,6 @@ export const linearCreateProjectStatusTool: ToolConfig<
8284
if (params.indefinite != null) {
8385
input.indefinite = params.indefinite
8486
}
85-
if (params.position != null) {
86-
input.position = params.position
87-
}
8887

8988
return {
9089
query: `

0 commit comments

Comments
 (0)