Skip to content

Commit f2cf405

Browse files
committed
updated types
1 parent 116e16e commit f2cf405

File tree

6 files changed

+61
-4
lines changed

6 files changed

+61
-4
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ Retrieve detailed information about a specific Jira issue
227227
|`timeZone` | string | User timezone |
228228
|`created` | string | ISO 8601 timestamp when the attachment was created |
229229
| `issueKey` | string | Issue key \(e.g., PROJ-123\) |
230+
| `issue` | json | Complete raw Jira issue object from the API |
230231

231232
### `jira_update`
232233

@@ -296,6 +297,7 @@ Create a new Jira issue
296297
| `self` | string | REST API URL for the created issue |
297298
| `summary` | string | Issue summary |
298299
| `url` | string | URL to the created issue in Jira |
300+
| `assigneeId` | string | Account ID of the assigned user \(null if no assignee was set\) |
299301

300302
### `jira_bulk_read`
301303

@@ -685,6 +687,11 @@ Add attachments to a Jira issue
685687
|`mimeType` | string | MIME type |
686688
|`size` | number | File size in bytes |
687689
|`content` | string | URL to download the attachment |
690+
| `attachmentIds` | array | Array of attachment IDs |
691+
| `files` | array | Uploaded file metadata |
692+
|`name` | string | File name |
693+
|`mimeType` | string | MIME type |
694+
|`size` | number | File size in bytes |
688695

689696
### `jira_delete_attachment`
690697

apps/sim/app/api/tools/jira/add-attachment/route.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,24 @@ export async function POST(request: NextRequest) {
9090
)
9191
}
9292

93-
const attachments = await response.json()
94-
const attachmentIds = Array.isArray(attachments)
95-
? attachments.map((attachment) => attachment.id).filter(Boolean)
96-
: []
93+
const jiraAttachments = await response.json()
94+
const attachmentsList = Array.isArray(jiraAttachments) ? jiraAttachments : []
95+
96+
const attachmentIds = attachmentsList.map((att: any) => att.id).filter(Boolean)
97+
const attachments = attachmentsList.map((att: any) => ({
98+
id: att.id ?? '',
99+
filename: att.filename ?? '',
100+
mimeType: att.mimeType ?? '',
101+
size: att.size ?? 0,
102+
content: att.content ?? '',
103+
}))
97104

98105
return NextResponse.json({
99106
success: true,
100107
output: {
101108
ts: new Date().toISOString(),
102109
issueKey: validatedData.issueKey,
110+
attachments,
103111
attachmentIds,
104112
files: filesOutput,
105113
},

apps/sim/tools/jira/add_attachment.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,24 @@ export const jiraAddAttachmentTool: ToolConfig<JiraAddAttachmentParams, JiraAddA
9292
},
9393
},
9494
},
95+
attachmentIds: {
96+
type: 'array',
97+
description: 'Array of attachment IDs',
98+
items: { type: 'string' },
99+
optional: true,
100+
},
101+
files: {
102+
type: 'array',
103+
description: 'Uploaded file metadata',
104+
items: {
105+
type: 'object',
106+
properties: {
107+
name: { type: 'string', description: 'File name' },
108+
mimeType: { type: 'string', description: 'MIME type' },
109+
size: { type: 'number', description: 'File size in bytes' },
110+
},
111+
},
112+
optional: true,
113+
},
95114
},
96115
}

apps/sim/tools/jira/retrieve.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,18 @@ export const jiraRetrieveTool: ToolConfig<JiraRetrieveParams, JiraRetrieveRespon
321321
output: {
322322
ts: new Date().toISOString(),
323323
...transformIssueData(data),
324+
issue: data,
324325
},
325326
}
326327
},
327328

328329
outputs: {
329330
ts: TIMESTAMP_OUTPUT,
330331
...ISSUE_ITEM_PROPERTIES,
332+
issue: {
333+
type: 'json',
334+
description: 'Complete raw Jira issue object from the API',
335+
optional: true,
336+
},
331337
},
332338
}

apps/sim/tools/jira/types.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,7 @@ export interface JiraRetrieveResponse extends ToolResponse {
748748
output: {
749749
ts: string
750750
id: string
751+
issueKey: string
751752
key: string
752753
self: string
753754
summary: string
@@ -861,6 +862,7 @@ export interface JiraRetrieveResponse extends ToolResponse {
861862
author: { accountId: string; displayName: string } | null
862863
created: string
863864
}>
865+
issue: Record<string, unknown>
864866
}
865867
}
866868

@@ -952,6 +954,7 @@ export interface JiraWriteResponse extends ToolResponse {
952954
summary: string
953955
success: boolean
954956
url: string
957+
assigneeId: string | null
955958
}
956959
}
957960

@@ -1224,6 +1227,12 @@ export interface JiraAddAttachmentResponse extends ToolResponse {
12241227
size: number
12251228
content: string
12261229
}>
1230+
attachmentIds: string[]
1231+
files: Array<{
1232+
name: string
1233+
mimeType: string
1234+
size: number
1235+
}>
12271236
}
12281237
}
12291238

apps/sim/tools/jira/write.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ export const jiraWriteTool: ToolConfig<JiraWriteParams, JiraWriteResponse> = {
169169
summary: 'Issue created successfully',
170170
success: true,
171171
url: '',
172+
assigneeId: null,
172173
},
173174
}
174175
}
@@ -186,6 +187,7 @@ export const jiraWriteTool: ToolConfig<JiraWriteParams, JiraWriteResponse> = {
186187
summary: data.output.summary ?? '',
187188
success: data.output.success ?? true,
188189
url: data.output.url ?? '',
190+
assigneeId: data.output.assigneeId ?? null,
189191
},
190192
}
191193
}
@@ -200,6 +202,7 @@ export const jiraWriteTool: ToolConfig<JiraWriteParams, JiraWriteResponse> = {
200202
summary: data.output?.summary ?? 'Issue created',
201203
success: false,
202204
url: data.output?.url ?? '',
205+
assigneeId: data.output?.assigneeId ?? null,
203206
},
204207
error: data.error,
205208
}
@@ -212,5 +215,10 @@ export const jiraWriteTool: ToolConfig<JiraWriteParams, JiraWriteResponse> = {
212215
self: { type: 'string', description: 'REST API URL for the created issue' },
213216
summary: { type: 'string', description: 'Issue summary' },
214217
url: { type: 'string', description: 'URL to the created issue in Jira' },
218+
assigneeId: {
219+
type: 'string',
220+
description: 'Account ID of the assigned user (null if no assignee was set)',
221+
optional: true,
222+
},
215223
},
216224
}

0 commit comments

Comments
 (0)