mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
fix(linear): update required fields (#2070)
This commit is contained in:
@@ -42,8 +42,8 @@ Fetch and filter issues from Linear
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `teamId` | string | Yes | Linear team ID |
|
||||
| `projectId` | string | Yes | Linear project ID |
|
||||
| `teamId` | string | No | Linear team ID to filter by |
|
||||
| `projectId` | string | No | Linear project ID to filter by |
|
||||
|
||||
#### Output
|
||||
|
||||
@@ -76,7 +76,7 @@ Create a new issue in Linear
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `teamId` | string | Yes | Linear team ID |
|
||||
| `projectId` | string | Yes | Linear project ID |
|
||||
| `projectId` | string | No | Linear project ID |
|
||||
| `title` | string | Yes | Issue title |
|
||||
| `description` | string | No | Issue description |
|
||||
|
||||
@@ -240,7 +240,7 @@ Edit a comment in Linear
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `commentId` | string | Yes | Comment ID to update |
|
||||
| `body` | string | Yes | New comment text \(supports Markdown\) |
|
||||
| `body` | string | No | New comment text \(supports Markdown\) |
|
||||
|
||||
#### Output
|
||||
|
||||
@@ -640,7 +640,7 @@ Add an attachment to an issue in Linear
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `issueId` | string | Yes | Issue ID to attach to |
|
||||
| `url` | string | Yes | URL of the attachment |
|
||||
| `title` | string | No | Attachment title |
|
||||
| `title` | string | Yes | Attachment title |
|
||||
| `subtitle` | string | No | Attachment subtitle/description |
|
||||
|
||||
#### Output
|
||||
@@ -676,7 +676,7 @@ Update an attachment metadata in Linear
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `attachmentId` | string | Yes | Attachment ID to update |
|
||||
| `title` | string | No | New attachment title |
|
||||
| `title` | string | Yes | New attachment title |
|
||||
| `subtitle` | string | No | New attachment subtitle |
|
||||
|
||||
#### Output
|
||||
|
||||
@@ -146,6 +146,17 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
|
||||
placeholder: 'Select a team',
|
||||
dependsOn: ['credential'],
|
||||
mode: 'basic',
|
||||
required: {
|
||||
field: 'operation',
|
||||
value: [
|
||||
'linear_create_issue',
|
||||
'linear_create_project',
|
||||
'linear_list_workflow_states',
|
||||
'linear_create_workflow_state',
|
||||
'linear_create_cycle',
|
||||
'linear_get_active_cycle',
|
||||
],
|
||||
},
|
||||
condition: {
|
||||
field: 'operation',
|
||||
value: [
|
||||
@@ -172,6 +183,17 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
|
||||
canonicalParamId: 'teamId',
|
||||
placeholder: 'Enter Linear team ID',
|
||||
mode: 'advanced',
|
||||
required: {
|
||||
field: 'operation',
|
||||
value: [
|
||||
'linear_create_issue',
|
||||
'linear_create_project',
|
||||
'linear_list_workflow_states',
|
||||
'linear_create_workflow_state',
|
||||
'linear_create_cycle',
|
||||
'linear_get_active_cycle',
|
||||
],
|
||||
},
|
||||
condition: {
|
||||
field: 'operation',
|
||||
value: [
|
||||
@@ -201,6 +223,16 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
|
||||
placeholder: 'Select a project',
|
||||
dependsOn: ['credential', 'teamId'],
|
||||
mode: 'basic',
|
||||
required: {
|
||||
field: 'operation',
|
||||
value: [
|
||||
'linear_get_project',
|
||||
'linear_update_project',
|
||||
'linear_archive_project',
|
||||
'linear_delete_project',
|
||||
'linear_list_project_updates',
|
||||
],
|
||||
},
|
||||
condition: {
|
||||
field: 'operation',
|
||||
value: [
|
||||
@@ -223,6 +255,18 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
|
||||
canonicalParamId: 'projectId',
|
||||
placeholder: 'Enter Linear project ID',
|
||||
mode: 'advanced',
|
||||
required: {
|
||||
field: 'operation',
|
||||
value: [
|
||||
'linear_get_project',
|
||||
'linear_update_project',
|
||||
'linear_archive_project',
|
||||
'linear_delete_project',
|
||||
'linear_create_project_update',
|
||||
'linear_list_project_updates',
|
||||
'linear_create_project_link',
|
||||
],
|
||||
},
|
||||
condition: {
|
||||
field: 'operation',
|
||||
value: [
|
||||
@@ -299,7 +343,10 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
|
||||
title: 'Comment',
|
||||
type: 'long-input',
|
||||
placeholder: 'Enter comment text',
|
||||
required: true,
|
||||
required: {
|
||||
field: 'operation',
|
||||
value: ['linear_create_comment', 'linear_create_project_update'],
|
||||
},
|
||||
condition: {
|
||||
field: 'operation',
|
||||
value: ['linear_create_comment', 'linear_update_comment', 'linear_create_project_update'],
|
||||
@@ -505,6 +552,7 @@ export const LinearBlock: BlockConfig<LinearResponse> = {
|
||||
title: 'Title',
|
||||
type: 'short-input',
|
||||
placeholder: 'Enter attachment title',
|
||||
required: true,
|
||||
condition: {
|
||||
field: 'operation',
|
||||
value: ['linear_create_attachment', 'linear_update_attachment'],
|
||||
|
||||
@@ -61,11 +61,20 @@ export const linearArchiveProjectTool: ToolConfig<
|
||||
}
|
||||
}
|
||||
|
||||
const result = data.data.projectArchive
|
||||
if (!result.success) {
|
||||
return {
|
||||
success: false,
|
||||
error: 'Project archive was not successful',
|
||||
output: {},
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
success: data.data.projectArchive.success,
|
||||
success: true,
|
||||
output: {
|
||||
success: data.data.projectArchive.success,
|
||||
projectId: response.ok ? data.data.projectArchive.success : '',
|
||||
success: result.success,
|
||||
projectId: result.entity?.id || '',
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
@@ -33,7 +33,7 @@ export const linearCreateAttachmentTool: ToolConfig<
|
||||
},
|
||||
title: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Attachment title',
|
||||
},
|
||||
@@ -61,10 +61,9 @@ export const linearCreateAttachmentTool: ToolConfig<
|
||||
const input: Record<string, any> = {
|
||||
issueId: params.issueId,
|
||||
url: params.url,
|
||||
title: params.title,
|
||||
}
|
||||
|
||||
if (params.title !== undefined && params.title !== null && params.title !== '')
|
||||
input.title = params.title
|
||||
if (params.subtitle !== undefined && params.subtitle !== null && params.subtitle !== '')
|
||||
input.subtitle = params.subtitle
|
||||
|
||||
|
||||
@@ -162,8 +162,16 @@ export const linearCreateCustomerTool: ToolConfig<
|
||||
}
|
||||
|
||||
const result = data.data.customerCreate
|
||||
if (!result.success) {
|
||||
return {
|
||||
success: false,
|
||||
error: 'Customer creation was not successful',
|
||||
output: {},
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
success: result.success,
|
||||
success: true,
|
||||
output: {
|
||||
customer: result.customer,
|
||||
},
|
||||
|
||||
@@ -133,8 +133,16 @@ export const linearCreateCustomerRequestTool: ToolConfig<
|
||||
}
|
||||
|
||||
const result = data.data.customerNeedCreate
|
||||
if (!result.success) {
|
||||
return {
|
||||
success: false,
|
||||
error: 'Customer request creation was not successful',
|
||||
output: {},
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
success: result.success,
|
||||
success: true,
|
||||
output: {
|
||||
customerNeed: result.need,
|
||||
},
|
||||
|
||||
@@ -124,8 +124,16 @@ export const linearCreateCustomerStatusTool: ToolConfig<
|
||||
}
|
||||
|
||||
const result = data.data.customerStatusCreate
|
||||
if (!result.success) {
|
||||
return {
|
||||
success: false,
|
||||
error: 'Customer status creation was not successful',
|
||||
output: {},
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
success: result.success,
|
||||
success: true,
|
||||
output: {
|
||||
customerStatus: result.status,
|
||||
},
|
||||
|
||||
@@ -124,8 +124,16 @@ export const linearCreateCustomerTierTool: ToolConfig<
|
||||
}
|
||||
|
||||
const result = data.data.customerTierCreate
|
||||
if (!result.success) {
|
||||
return {
|
||||
success: false,
|
||||
error: 'Customer tier creation was not successful',
|
||||
output: {},
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
success: result.success,
|
||||
success: true,
|
||||
output: {
|
||||
customerTier: result.customerTier,
|
||||
},
|
||||
|
||||
@@ -22,7 +22,7 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
|
||||
},
|
||||
projectId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
required: false,
|
||||
visibility: 'user-only',
|
||||
description: 'Linear project ID',
|
||||
},
|
||||
@@ -56,17 +56,31 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
|
||||
if (!params.title || !params.title.trim()) {
|
||||
throw new Error('Title is required to create a Linear issue')
|
||||
}
|
||||
|
||||
const input: Record<string, any> = {
|
||||
teamId: params.teamId,
|
||||
title: params.title,
|
||||
}
|
||||
|
||||
if (
|
||||
params.projectId !== undefined &&
|
||||
params.projectId !== null &&
|
||||
params.projectId !== ''
|
||||
) {
|
||||
input.projectId = params.projectId
|
||||
}
|
||||
if (
|
||||
params.description !== undefined &&
|
||||
params.description !== null &&
|
||||
params.description !== ''
|
||||
) {
|
||||
input.description = params.description
|
||||
}
|
||||
|
||||
return {
|
||||
query: `
|
||||
mutation CreateIssue($teamId: String!, $projectId: String!, $title: String!, $description: String) {
|
||||
issueCreate(
|
||||
input: {
|
||||
teamId: $teamId
|
||||
projectId: $projectId
|
||||
title: $title
|
||||
description: $description
|
||||
}
|
||||
) {
|
||||
mutation CreateIssue($input: IssueCreateInput!) {
|
||||
issueCreate(input: $input) {
|
||||
issue {
|
||||
id
|
||||
title
|
||||
@@ -79,12 +93,7 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
|
||||
}
|
||||
`,
|
||||
variables: {
|
||||
teamId: params.teamId,
|
||||
projectId: params.projectId,
|
||||
title: params.title,
|
||||
...(params.description !== undefined &&
|
||||
params.description !== null &&
|
||||
params.description !== '' && { description: params.description }),
|
||||
input,
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -92,7 +101,25 @@ export const linearCreateIssueTool: ToolConfig<LinearCreateIssueParams, LinearCr
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
const issue = data.data.issueCreate.issue
|
||||
|
||||
if (data.errors) {
|
||||
return {
|
||||
success: false,
|
||||
error: data.errors[0]?.message || 'Failed to create issue',
|
||||
output: {},
|
||||
}
|
||||
}
|
||||
|
||||
const result = data.data?.issueCreate
|
||||
if (!result) {
|
||||
return {
|
||||
success: false,
|
||||
error: 'Issue creation was not successful',
|
||||
output: {},
|
||||
}
|
||||
}
|
||||
|
||||
const issue = result.issue
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
|
||||
@@ -78,11 +78,29 @@ export const linearCreateProjectTool: ToolConfig<
|
||||
name: params.name,
|
||||
}
|
||||
|
||||
if (params.description !== undefined) input.description = params.description
|
||||
if (params.leadId !== undefined) input.leadId = params.leadId
|
||||
if (params.startDate !== undefined) input.startDate = params.startDate
|
||||
if (params.targetDate !== undefined) input.targetDate = params.targetDate
|
||||
if (params.priority !== undefined) input.priority = Number(params.priority)
|
||||
if (
|
||||
params.description !== undefined &&
|
||||
params.description !== null &&
|
||||
params.description !== ''
|
||||
) {
|
||||
input.description = params.description
|
||||
}
|
||||
if (params.leadId !== undefined && params.leadId !== null && params.leadId !== '') {
|
||||
input.leadId = params.leadId
|
||||
}
|
||||
if (params.startDate !== undefined && params.startDate !== null && params.startDate !== '') {
|
||||
input.startDate = params.startDate
|
||||
}
|
||||
if (
|
||||
params.targetDate !== undefined &&
|
||||
params.targetDate !== null &&
|
||||
params.targetDate !== ''
|
||||
) {
|
||||
input.targetDate = params.targetDate
|
||||
}
|
||||
if (params.priority !== undefined && params.priority !== null) {
|
||||
input.priority = Number(params.priority)
|
||||
}
|
||||
|
||||
return {
|
||||
query: `
|
||||
|
||||
@@ -121,8 +121,16 @@ export const linearCreateProjectLabelTool: ToolConfig<
|
||||
}
|
||||
|
||||
const result = data.data.projectLabelCreate
|
||||
if (!result.success) {
|
||||
return {
|
||||
success: false,
|
||||
error: 'Project label creation was not successful',
|
||||
output: {},
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
success: result.success,
|
||||
success: true,
|
||||
output: {
|
||||
projectLabel: result.projectLabel,
|
||||
},
|
||||
|
||||
@@ -114,8 +114,16 @@ export const linearCreateProjectMilestoneTool: ToolConfig<
|
||||
}
|
||||
|
||||
const result = data.data.projectMilestoneCreate
|
||||
if (!result.success) {
|
||||
return {
|
||||
success: false,
|
||||
error: 'Project milestone creation was not successful',
|
||||
output: {},
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
success: result.success,
|
||||
success: true,
|
||||
output: {
|
||||
projectMilestone: result.projectMilestone,
|
||||
},
|
||||
|
||||
@@ -120,8 +120,16 @@ export const linearCreateProjectStatusTool: ToolConfig<
|
||||
}
|
||||
|
||||
const result = data.data.projectStatusCreate
|
||||
if (!result.success) {
|
||||
return {
|
||||
success: false,
|
||||
error: 'Project status creation was not successful',
|
||||
output: {},
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
success: result.success,
|
||||
success: true,
|
||||
output: {
|
||||
projectStatus: result.status,
|
||||
},
|
||||
|
||||
@@ -77,8 +77,16 @@ export const linearCreateWorkflowStateTool: ToolConfig<
|
||||
type: params.type,
|
||||
}
|
||||
|
||||
if (params.description !== undefined) input.description = params.description
|
||||
if (params.position !== undefined) input.position = Number(params.position)
|
||||
if (
|
||||
params.description !== undefined &&
|
||||
params.description !== null &&
|
||||
params.description !== ''
|
||||
) {
|
||||
input.description = params.description
|
||||
}
|
||||
if (params.position !== undefined && params.position !== null) {
|
||||
input.position = Number(params.position)
|
||||
}
|
||||
|
||||
return {
|
||||
query: `
|
||||
|
||||
@@ -73,6 +73,14 @@ export const linearGetActiveCycleTool: ToolConfig<
|
||||
}
|
||||
}
|
||||
|
||||
if (!data.data?.team) {
|
||||
return {
|
||||
success: false,
|
||||
error: 'Team not found',
|
||||
output: {},
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
|
||||
@@ -91,6 +91,14 @@ export const linearListAttachmentsTool: ToolConfig<
|
||||
}
|
||||
}
|
||||
|
||||
if (!data.data?.issue) {
|
||||
return {
|
||||
success: false,
|
||||
error: 'Issue not found',
|
||||
output: {},
|
||||
}
|
||||
}
|
||||
|
||||
const result = data.data.issue.attachments
|
||||
return {
|
||||
success: true,
|
||||
|
||||
@@ -91,6 +91,14 @@ export const linearListCommentsTool: ToolConfig<
|
||||
}
|
||||
}
|
||||
|
||||
if (!data.data?.issue) {
|
||||
return {
|
||||
success: false,
|
||||
error: 'Issue not found',
|
||||
output: {},
|
||||
}
|
||||
}
|
||||
|
||||
const result = data.data.issue.comments
|
||||
return {
|
||||
success: true,
|
||||
|
||||
@@ -95,6 +95,14 @@ export const linearListIssueRelationsTool: ToolConfig<
|
||||
}
|
||||
}
|
||||
|
||||
if (!data.data?.issue) {
|
||||
return {
|
||||
success: false,
|
||||
error: 'Issue not found',
|
||||
output: {},
|
||||
}
|
||||
}
|
||||
|
||||
const result = data.data.issue.relations
|
||||
return {
|
||||
success: true,
|
||||
|
||||
@@ -93,6 +93,14 @@ export const linearListProjectUpdatesTool: ToolConfig<
|
||||
}
|
||||
}
|
||||
|
||||
if (!data.data?.project) {
|
||||
return {
|
||||
success: false,
|
||||
error: 'Project not found',
|
||||
output: {},
|
||||
}
|
||||
}
|
||||
|
||||
const result = data.data.project.projectUpdates
|
||||
return {
|
||||
success: true,
|
||||
|
||||
@@ -19,15 +19,15 @@ export const linearReadIssuesTool: ToolConfig<LinearReadIssuesParams, LinearRead
|
||||
params: {
|
||||
teamId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
required: false,
|
||||
visibility: 'user-only',
|
||||
description: 'Linear team ID',
|
||||
description: 'Linear team ID to filter by',
|
||||
},
|
||||
projectId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
required: false,
|
||||
visibility: 'user-only',
|
||||
description: 'Linear project ID',
|
||||
description: 'Linear project ID to filter by',
|
||||
},
|
||||
},
|
||||
|
||||
@@ -43,15 +43,20 @@ export const linearReadIssuesTool: ToolConfig<LinearReadIssuesParams, LinearRead
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
}
|
||||
},
|
||||
body: (params) => ({
|
||||
query: `
|
||||
query Issues($teamId: ID!, $projectId: ID!) {
|
||||
issues(
|
||||
filter: {
|
||||
team: { id: { eq: $teamId } }
|
||||
project: { id: { eq: $projectId } }
|
||||
}
|
||||
) {
|
||||
body: (params) => {
|
||||
const filter: Record<string, any> = {}
|
||||
|
||||
if (params.teamId !== undefined && params.teamId !== null && params.teamId !== '') {
|
||||
filter.team = { id: { eq: params.teamId } }
|
||||
}
|
||||
if (params.projectId !== undefined && params.projectId !== null && params.projectId !== '') {
|
||||
filter.project = { id: { eq: params.projectId } }
|
||||
}
|
||||
|
||||
return {
|
||||
query: `
|
||||
query Issues($filter: IssueFilter) {
|
||||
issues(filter: $filter) {
|
||||
nodes {
|
||||
id
|
||||
title
|
||||
@@ -63,15 +68,32 @@ export const linearReadIssuesTool: ToolConfig<LinearReadIssuesParams, LinearRead
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: {
|
||||
teamId: params.teamId,
|
||||
projectId: params.projectId,
|
||||
},
|
||||
}),
|
||||
variables: {
|
||||
filter: Object.keys(filter).length > 0 ? filter : undefined,
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
const data = await response.json()
|
||||
|
||||
if (data.errors) {
|
||||
return {
|
||||
success: false,
|
||||
error: data.errors[0]?.message || 'Failed to fetch issues',
|
||||
output: {},
|
||||
}
|
||||
}
|
||||
|
||||
if (!data.data?.issues) {
|
||||
return {
|
||||
success: false,
|
||||
error: 'No issues data returned',
|
||||
output: {},
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
|
||||
@@ -27,7 +27,7 @@ export const linearUpdateAttachmentTool: ToolConfig<
|
||||
},
|
||||
title: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'New attachment title',
|
||||
},
|
||||
@@ -52,10 +52,10 @@ export const linearUpdateAttachmentTool: ToolConfig<
|
||||
}
|
||||
},
|
||||
body: (params) => {
|
||||
const input: Record<string, any> = {}
|
||||
const input: Record<string, any> = {
|
||||
title: params.title,
|
||||
}
|
||||
|
||||
if (params.title !== undefined && params.title !== null && params.title !== '')
|
||||
input.title = params.title
|
||||
if (params.subtitle !== undefined && params.subtitle !== null && params.subtitle !== '')
|
||||
input.subtitle = params.subtitle
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export const linearUpdateCommentTool: ToolConfig<
|
||||
},
|
||||
body: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'New comment text (supports Markdown)',
|
||||
},
|
||||
@@ -42,8 +42,14 @@ export const linearUpdateCommentTool: ToolConfig<
|
||||
Authorization: `Bearer ${params.accessToken}`,
|
||||
}
|
||||
},
|
||||
body: (params) => ({
|
||||
query: `
|
||||
body: (params) => {
|
||||
const input: Record<string, any> = {}
|
||||
|
||||
if (params.body !== undefined && params.body !== null && params.body !== '')
|
||||
input.body = params.body
|
||||
|
||||
return {
|
||||
query: `
|
||||
mutation UpdateComment($id: String!, $input: CommentUpdateInput!) {
|
||||
commentUpdate(id: $id, input: $input) {
|
||||
success
|
||||
@@ -61,13 +67,12 @@ export const linearUpdateCommentTool: ToolConfig<
|
||||
}
|
||||
}
|
||||
`,
|
||||
variables: {
|
||||
id: params.commentId,
|
||||
input: {
|
||||
body: params.body,
|
||||
variables: {
|
||||
id: params.commentId,
|
||||
input,
|
||||
},
|
||||
},
|
||||
}),
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
transformResponse: async (response) => {
|
||||
|
||||
@@ -79,13 +79,39 @@ export const linearUpdateIssueTool: ToolConfig<LinearUpdateIssueParams, LinearUp
|
||||
body: (params) => {
|
||||
const input: Record<string, any> = {}
|
||||
|
||||
if (params.title !== undefined) input.title = params.title
|
||||
if (params.description !== undefined) input.description = params.description
|
||||
if (params.stateId !== undefined) input.stateId = params.stateId
|
||||
if (params.assigneeId !== undefined) input.assigneeId = params.assigneeId
|
||||
if (params.priority !== undefined) input.priority = Number(params.priority)
|
||||
if (params.estimate !== undefined) input.estimate = Number(params.estimate)
|
||||
if (params.labelIds !== undefined) input.labelIds = params.labelIds
|
||||
if (params.title !== undefined && params.title !== null && params.title !== '') {
|
||||
input.title = params.title
|
||||
}
|
||||
if (
|
||||
params.description !== undefined &&
|
||||
params.description !== null &&
|
||||
params.description !== ''
|
||||
) {
|
||||
input.description = params.description
|
||||
}
|
||||
if (params.stateId !== undefined && params.stateId !== null && params.stateId !== '') {
|
||||
input.stateId = params.stateId
|
||||
}
|
||||
if (
|
||||
params.assigneeId !== undefined &&
|
||||
params.assigneeId !== null &&
|
||||
params.assigneeId !== ''
|
||||
) {
|
||||
input.assigneeId = params.assigneeId
|
||||
}
|
||||
if (params.priority !== undefined && params.priority !== null) {
|
||||
input.priority = Number(params.priority)
|
||||
}
|
||||
if (params.estimate !== undefined && params.estimate !== null) {
|
||||
input.estimate = Number(params.estimate)
|
||||
}
|
||||
if (
|
||||
params.labelIds !== undefined &&
|
||||
params.labelIds !== null &&
|
||||
Array.isArray(params.labelIds)
|
||||
) {
|
||||
input.labelIds = params.labelIds
|
||||
}
|
||||
|
||||
return {
|
||||
query: `
|
||||
|
||||
@@ -81,13 +81,35 @@ export const linearUpdateProjectTool: ToolConfig<
|
||||
body: (params) => {
|
||||
const input: Record<string, any> = {}
|
||||
|
||||
if (params.name !== undefined) input.name = params.name
|
||||
if (params.description !== undefined) input.description = params.description
|
||||
if (params.state !== undefined) input.state = params.state
|
||||
if (params.leadId !== undefined) input.leadId = params.leadId
|
||||
if (params.startDate !== undefined) input.startDate = params.startDate
|
||||
if (params.targetDate !== undefined) input.targetDate = params.targetDate
|
||||
if (params.priority !== undefined) input.priority = Number(params.priority)
|
||||
if (params.name !== undefined && params.name !== null && params.name !== '') {
|
||||
input.name = params.name
|
||||
}
|
||||
if (
|
||||
params.description !== undefined &&
|
||||
params.description !== null &&
|
||||
params.description !== ''
|
||||
) {
|
||||
input.description = params.description
|
||||
}
|
||||
if (params.state !== undefined && params.state !== null && params.state !== '') {
|
||||
input.state = params.state
|
||||
}
|
||||
if (params.leadId !== undefined && params.leadId !== null && params.leadId !== '') {
|
||||
input.leadId = params.leadId
|
||||
}
|
||||
if (params.startDate !== undefined && params.startDate !== null && params.startDate !== '') {
|
||||
input.startDate = params.startDate
|
||||
}
|
||||
if (
|
||||
params.targetDate !== undefined &&
|
||||
params.targetDate !== null &&
|
||||
params.targetDate !== ''
|
||||
) {
|
||||
input.targetDate = params.targetDate
|
||||
}
|
||||
if (params.priority !== undefined && params.priority !== null) {
|
||||
input.priority = Number(params.priority)
|
||||
}
|
||||
|
||||
return {
|
||||
query: `
|
||||
|
||||
@@ -66,10 +66,22 @@ export const linearUpdateWorkflowStateTool: ToolConfig<
|
||||
body: (params) => {
|
||||
const input: Record<string, any> = {}
|
||||
|
||||
if (params.name !== undefined) input.name = params.name
|
||||
if (params.color !== undefined) input.color = params.color
|
||||
if (params.description !== undefined) input.description = params.description
|
||||
if (params.position !== undefined) input.position = Number(params.position)
|
||||
if (params.name !== undefined && params.name !== null && params.name !== '') {
|
||||
input.name = params.name
|
||||
}
|
||||
if (params.color !== undefined && params.color !== null && params.color !== '') {
|
||||
input.color = params.color
|
||||
}
|
||||
if (
|
||||
params.description !== undefined &&
|
||||
params.description !== null &&
|
||||
params.description !== ''
|
||||
) {
|
||||
input.description = params.description
|
||||
}
|
||||
if (params.position !== undefined && params.position !== null) {
|
||||
input.position = Number(params.position)
|
||||
}
|
||||
|
||||
return {
|
||||
query: `
|
||||
|
||||
Reference in New Issue
Block a user