From f2cf405aad716db3db11fe6d94c674d32240dcb7 Mon Sep 17 00:00:00 2001 From: waleed Date: Mon, 9 Feb 2026 17:56:06 -0800 Subject: [PATCH] updated types --- apps/docs/content/docs/en/tools/jira.mdx | 7 +++++++ .../api/tools/jira/add-attachment/route.ts | 16 ++++++++++++---- apps/sim/tools/jira/add_attachment.ts | 19 +++++++++++++++++++ apps/sim/tools/jira/retrieve.ts | 6 ++++++ apps/sim/tools/jira/types.ts | 9 +++++++++ apps/sim/tools/jira/write.ts | 8 ++++++++ 6 files changed, 61 insertions(+), 4 deletions(-) diff --git a/apps/docs/content/docs/en/tools/jira.mdx b/apps/docs/content/docs/en/tools/jira.mdx index 04b370788..179d7023a 100644 --- a/apps/docs/content/docs/en/tools/jira.mdx +++ b/apps/docs/content/docs/en/tools/jira.mdx @@ -227,6 +227,7 @@ Retrieve detailed information about a specific Jira issue | ↳ `timeZone` | string | User timezone | | ↳ `created` | string | ISO 8601 timestamp when the attachment was created | | `issueKey` | string | Issue key \(e.g., PROJ-123\) | +| `issue` | json | Complete raw Jira issue object from the API | ### `jira_update` @@ -296,6 +297,7 @@ Create a new Jira issue | `self` | string | REST API URL for the created issue | | `summary` | string | Issue summary | | `url` | string | URL to the created issue in Jira | +| `assigneeId` | string | Account ID of the assigned user \(null if no assignee was set\) | ### `jira_bulk_read` @@ -685,6 +687,11 @@ Add attachments to a Jira issue | ↳ `mimeType` | string | MIME type | | ↳ `size` | number | File size in bytes | | ↳ `content` | string | URL to download the attachment | +| `attachmentIds` | array | Array of attachment IDs | +| `files` | array | Uploaded file metadata | +| ↳ `name` | string | File name | +| ↳ `mimeType` | string | MIME type | +| ↳ `size` | number | File size in bytes | ### `jira_delete_attachment` diff --git a/apps/sim/app/api/tools/jira/add-attachment/route.ts b/apps/sim/app/api/tools/jira/add-attachment/route.ts index 52b36b24a..63b031032 100644 --- a/apps/sim/app/api/tools/jira/add-attachment/route.ts +++ b/apps/sim/app/api/tools/jira/add-attachment/route.ts @@ -90,16 +90,24 @@ export async function POST(request: NextRequest) { ) } - const attachments = await response.json() - const attachmentIds = Array.isArray(attachments) - ? attachments.map((attachment) => attachment.id).filter(Boolean) - : [] + const jiraAttachments = await response.json() + const attachmentsList = Array.isArray(jiraAttachments) ? jiraAttachments : [] + + const attachmentIds = attachmentsList.map((att: any) => att.id).filter(Boolean) + const attachments = attachmentsList.map((att: any) => ({ + id: att.id ?? '', + filename: att.filename ?? '', + mimeType: att.mimeType ?? '', + size: att.size ?? 0, + content: att.content ?? '', + })) return NextResponse.json({ success: true, output: { ts: new Date().toISOString(), issueKey: validatedData.issueKey, + attachments, attachmentIds, files: filesOutput, }, diff --git a/apps/sim/tools/jira/add_attachment.ts b/apps/sim/tools/jira/add_attachment.ts index 6dee33c20..07b6e1d16 100644 --- a/apps/sim/tools/jira/add_attachment.ts +++ b/apps/sim/tools/jira/add_attachment.ts @@ -92,5 +92,24 @@ export const jiraAddAttachmentTool: ToolConfig + issue: Record } } @@ -952,6 +954,7 @@ export interface JiraWriteResponse extends ToolResponse { summary: string success: boolean url: string + assigneeId: string | null } } @@ -1224,6 +1227,12 @@ export interface JiraAddAttachmentResponse extends ToolResponse { size: number content: string }> + attachmentIds: string[] + files: Array<{ + name: string + mimeType: string + size: number + }> } } diff --git a/apps/sim/tools/jira/write.ts b/apps/sim/tools/jira/write.ts index e84d7621e..47c8be58b 100644 --- a/apps/sim/tools/jira/write.ts +++ b/apps/sim/tools/jira/write.ts @@ -169,6 +169,7 @@ export const jiraWriteTool: ToolConfig = { summary: 'Issue created successfully', success: true, url: '', + assigneeId: null, }, } } @@ -186,6 +187,7 @@ export const jiraWriteTool: ToolConfig = { summary: data.output.summary ?? '', success: data.output.success ?? true, url: data.output.url ?? '', + assigneeId: data.output.assigneeId ?? null, }, } } @@ -200,6 +202,7 @@ export const jiraWriteTool: ToolConfig = { summary: data.output?.summary ?? 'Issue created', success: false, url: data.output?.url ?? '', + assigneeId: data.output?.assigneeId ?? null, }, error: data.error, } @@ -212,5 +215,10 @@ export const jiraWriteTool: ToolConfig = { self: { type: 'string', description: 'REST API URL for the created issue' }, summary: { type: 'string', description: 'Issue summary' }, url: { type: 'string', description: 'URL to the created issue in Jira' }, + assigneeId: { + type: 'string', + description: 'Account ID of the assigned user (null if no assignee was set)', + optional: true, + }, }, }