Skip to content

Commit 116e16e

Browse files
committed
restore old outputs
1 parent 2985b82 commit 116e16e

File tree

9 files changed

+42
-10
lines changed

9 files changed

+42
-10
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ Get a single service request from Jira Service Management
173173
|`value` | json | Field value |
174174
|`renderedValue` | json | HTML-rendered field value |
175175
| `url` | string | URL to the request |
176+
| `request` | json | The service request object |
176177

177178
### `jsm_get_requests`
178179

@@ -329,7 +330,8 @@ Add customers to a service desk in Jira Service Management
329330
| `domain` | string | Yes | Your Jira domain \(e.g., yourcompany.atlassian.net\) |
330331
| `cloudId` | string | No | Jira Cloud ID for the instance |
331332
| `serviceDeskId` | string | Yes | Service Desk ID \(e.g., "1", "2"\) |
332-
| `accountIds` | string | Yes | Comma-separated Atlassian account IDs to add as customers |
333+
| `accountIds` | string | No | Comma-separated Atlassian account IDs to add as customers |
334+
| `emails` | string | No | Comma-separated email addresses to add as customers |
333335

334336
#### Output
335337

@@ -639,6 +641,7 @@ Approve or decline an approval request in Jira Service Management
639641
|`approverDecision` | string | Individual approver decision |
640642
| `createdDate` | json | Approval creation date |
641643
| `completedDate` | json | Approval completion date |
644+
| `approval` | json | The approval object |
642645
| `success` | boolean | Whether the operation succeeded |
643646

644647
### `jsm_get_request_type_fields`

apps/sim/app/api/tools/jsm/approvals/route.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ export async function POST(request: NextRequest) {
183183
}),
184184
createdDate: data.createdDate ?? null,
185185
completedDate: data.completedDate ?? null,
186+
approval: data,
186187
success: true,
187188
},
188189
})

apps/sim/app/api/tools/jsm/customers/route.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export async function POST(request: NextRequest) {
2525
start,
2626
limit,
2727
accountIds,
28+
emails,
2829
} = body
2930

3031
if (!domain) {
@@ -56,14 +57,15 @@ export async function POST(request: NextRequest) {
5657

5758
const baseUrl = getJsmApiBaseUrl(cloudId)
5859

59-
const parsedAccountIds = accountIds
60-
? typeof accountIds === 'string'
61-
? accountIds
60+
const rawIds = accountIds || emails
61+
const parsedAccountIds = rawIds
62+
? typeof rawIds === 'string'
63+
? rawIds
6264
.split(',')
6365
.map((id: string) => id.trim())
6466
.filter((id: string) => id)
65-
: Array.isArray(accountIds)
66-
? accountIds
67+
: Array.isArray(rawIds)
68+
? rawIds
6769
: []
6870
: []
6971

apps/sim/app/api/tools/jsm/request/route.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ export async function POST(request: NextRequest) {
215215
value: fv.value ?? null,
216216
})),
217217
url: `https://${domain}/browse/${data.issueKey}`,
218+
request: data,
218219
},
219220
})
220221
} catch (error) {

apps/sim/blocks/blocks/jira_service_management.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,13 +593,14 @@ Return ONLY the comment text - no explanations.`,
593593
if (!params.serviceDeskId) {
594594
throw new Error('Service Desk ID is required')
595595
}
596-
if (!params.accountIds) {
597-
throw new Error('At least one account ID is required')
596+
if (!params.accountIds && !params.emails) {
597+
throw new Error('Account IDs or emails are required')
598598
}
599599
return {
600600
...baseParams,
601601
serviceDeskId: params.serviceDeskId,
602602
accountIds: params.accountIds,
603+
emails: params.emails,
603604
}
604605
}
605606
case 'get_organizations':
@@ -749,6 +750,10 @@ Return ONLY the comment text - no explanations.`,
749750
commentBody: { type: 'string', description: 'Comment text' },
750751
isPublic: { type: 'string', description: 'Whether comment is public or internal' },
751752
accountIds: { type: 'string', description: 'Comma-separated Atlassian account IDs' },
753+
emails: {
754+
type: 'string',
755+
description: 'Comma-separated email addresses',
756+
},
752757
customerQuery: { type: 'string', description: 'Customer search query' },
753758
transitionId: { type: 'string', description: 'Transition ID' },
754759
transitionComment: { type: 'string', description: 'Transition comment' },
@@ -799,6 +804,7 @@ Return ONLY the comment text - no explanations.`,
799804
transitionId: { type: 'string', description: 'Applied transition ID' },
800805
participants: { type: 'json', description: 'Array of participants' },
801806
approvals: { type: 'json', description: 'Array of approvals' },
807+
approval: { type: 'json', description: 'Approval object' },
802808
approvalId: { type: 'string', description: 'Approval ID' },
803809
decision: { type: 'string', description: 'Approval decision' },
804810
total: { type: 'number', description: 'Total count' },

apps/sim/tools/jsm/add_customer.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,16 @@ export const jsmAddCustomerTool: ToolConfig<JsmAddCustomerParams, JsmAddCustomer
3939
},
4040
accountIds: {
4141
type: 'string',
42-
required: true,
42+
required: false,
4343
visibility: 'user-or-llm',
4444
description: 'Comma-separated Atlassian account IDs to add as customers',
4545
},
46+
emails: {
47+
type: 'string',
48+
required: false,
49+
visibility: 'user-or-llm',
50+
description: 'Comma-separated email addresses to add as customers',
51+
},
4652
},
4753

4854
request: {
@@ -57,6 +63,7 @@ export const jsmAddCustomerTool: ToolConfig<JsmAddCustomerParams, JsmAddCustomer
5763
cloudId: params.cloudId,
5864
serviceDeskId: params.serviceDeskId,
5965
accountIds: params.accountIds,
66+
emails: params.emails,
6067
}),
6168
},
6269

apps/sim/tools/jsm/answer_approval.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ export const jsmAnswerApprovalTool: ToolConfig<JsmAnswerApprovalParams, JsmAnswe
153153
},
154154
createdDate: { type: 'json', description: 'Approval creation date', optional: true },
155155
completedDate: { type: 'json', description: 'Approval completion date', optional: true },
156+
approval: {
157+
type: 'json',
158+
description: 'The approval object',
159+
optional: true,
160+
},
156161
success: { type: 'boolean', description: 'Whether the operation succeeded' },
157162
},
158163
}

apps/sim/tools/jsm/get_request.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,9 @@ export const jsmGetRequestTool: ToolConfig<JsmGetRequestParams, JsmGetRequestRes
144144
},
145145
},
146146
url: { type: 'string', description: 'URL to the request' },
147+
request: {
148+
type: 'json',
149+
description: 'The service request object',
150+
},
147151
},
148152
}

apps/sim/tools/jsm/types.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,8 @@ export interface JsmGetCustomersParams extends JsmBaseParams {
459459

460460
export interface JsmAddCustomerParams extends JsmBaseParams {
461461
serviceDeskId: string
462-
accountIds: string
462+
accountIds?: string
463+
emails?: string
463464
}
464465

465466
export interface JsmGetOrganizationsParams extends JsmBaseParams {
@@ -592,6 +593,7 @@ export interface JsmGetRequestResponse extends ToolResponse {
592593
} | null
593594
requestFieldValues: Array<{ fieldId: string; label: string; value: unknown }>
594595
url: string
596+
request?: Record<string, unknown>
595597
}
596598
}
597599

@@ -759,6 +761,7 @@ export interface JsmAnswerApprovalResponse extends ToolResponse {
759761
}> | null
760762
createdDate: { iso8601: string; friendly: string; epochMillis: number } | null
761763
completedDate: { iso8601: string; friendly: string; epochMillis: number } | null
764+
approval?: Record<string, unknown>
762765
success: boolean
763766
}
764767
}

0 commit comments

Comments
 (0)