From 116e16ec507e90f972cdc61d69d64dd48b90cb96 Mon Sep 17 00:00:00 2001 From: waleed Date: Mon, 9 Feb 2026 16:58:47 -0800 Subject: [PATCH] restore old outputs --- .../docs/en/tools/jira_service_management.mdx | 5 ++++- apps/sim/app/api/tools/jsm/approvals/route.ts | 1 + apps/sim/app/api/tools/jsm/customers/route.ts | 12 +++++++----- apps/sim/app/api/tools/jsm/request/route.ts | 1 + apps/sim/blocks/blocks/jira_service_management.ts | 10 ++++++++-- apps/sim/tools/jsm/add_customer.ts | 9 ++++++++- apps/sim/tools/jsm/answer_approval.ts | 5 +++++ apps/sim/tools/jsm/get_request.ts | 4 ++++ apps/sim/tools/jsm/types.ts | 5 ++++- 9 files changed, 42 insertions(+), 10 deletions(-) diff --git a/apps/docs/content/docs/en/tools/jira_service_management.mdx b/apps/docs/content/docs/en/tools/jira_service_management.mdx index 39f2d99cc..9814f8103 100644 --- a/apps/docs/content/docs/en/tools/jira_service_management.mdx +++ b/apps/docs/content/docs/en/tools/jira_service_management.mdx @@ -173,6 +173,7 @@ Get a single service request from Jira Service Management | ↳ `value` | json | Field value | | ↳ `renderedValue` | json | HTML-rendered field value | | `url` | string | URL to the request | +| `request` | json | The service request object | ### `jsm_get_requests` @@ -329,7 +330,8 @@ Add customers to a service desk in Jira Service Management | `domain` | string | Yes | Your Jira domain \(e.g., yourcompany.atlassian.net\) | | `cloudId` | string | No | Jira Cloud ID for the instance | | `serviceDeskId` | string | Yes | Service Desk ID \(e.g., "1", "2"\) | -| `accountIds` | string | Yes | Comma-separated Atlassian account IDs to add as customers | +| `accountIds` | string | No | Comma-separated Atlassian account IDs to add as customers | +| `emails` | string | No | Comma-separated email addresses to add as customers | #### Output @@ -639,6 +641,7 @@ Approve or decline an approval request in Jira Service Management | ↳ `approverDecision` | string | Individual approver decision | | `createdDate` | json | Approval creation date | | `completedDate` | json | Approval completion date | +| `approval` | json | The approval object | | `success` | boolean | Whether the operation succeeded | ### `jsm_get_request_type_fields` diff --git a/apps/sim/app/api/tools/jsm/approvals/route.ts b/apps/sim/app/api/tools/jsm/approvals/route.ts index 151a8af85..e579121e8 100644 --- a/apps/sim/app/api/tools/jsm/approvals/route.ts +++ b/apps/sim/app/api/tools/jsm/approvals/route.ts @@ -183,6 +183,7 @@ export async function POST(request: NextRequest) { }), createdDate: data.createdDate ?? null, completedDate: data.completedDate ?? null, + approval: data, success: true, }, }) diff --git a/apps/sim/app/api/tools/jsm/customers/route.ts b/apps/sim/app/api/tools/jsm/customers/route.ts index 1b8da5040..cf9fcf7e6 100644 --- a/apps/sim/app/api/tools/jsm/customers/route.ts +++ b/apps/sim/app/api/tools/jsm/customers/route.ts @@ -25,6 +25,7 @@ export async function POST(request: NextRequest) { start, limit, accountIds, + emails, } = body if (!domain) { @@ -56,14 +57,15 @@ export async function POST(request: NextRequest) { const baseUrl = getJsmApiBaseUrl(cloudId) - const parsedAccountIds = accountIds - ? typeof accountIds === 'string' - ? accountIds + const rawIds = accountIds || emails + const parsedAccountIds = rawIds + ? typeof rawIds === 'string' + ? rawIds .split(',') .map((id: string) => id.trim()) .filter((id: string) => id) - : Array.isArray(accountIds) - ? accountIds + : Array.isArray(rawIds) + ? rawIds : [] : [] diff --git a/apps/sim/app/api/tools/jsm/request/route.ts b/apps/sim/app/api/tools/jsm/request/route.ts index a49ed2941..ae5b150b5 100644 --- a/apps/sim/app/api/tools/jsm/request/route.ts +++ b/apps/sim/app/api/tools/jsm/request/route.ts @@ -215,6 +215,7 @@ export async function POST(request: NextRequest) { value: fv.value ?? null, })), url: `https://${domain}/browse/${data.issueKey}`, + request: data, }, }) } catch (error) { diff --git a/apps/sim/blocks/blocks/jira_service_management.ts b/apps/sim/blocks/blocks/jira_service_management.ts index cbb0c3b7e..86ac86e75 100644 --- a/apps/sim/blocks/blocks/jira_service_management.ts +++ b/apps/sim/blocks/blocks/jira_service_management.ts @@ -593,13 +593,14 @@ Return ONLY the comment text - no explanations.`, if (!params.serviceDeskId) { throw new Error('Service Desk ID is required') } - if (!params.accountIds) { - throw new Error('At least one account ID is required') + if (!params.accountIds && !params.emails) { + throw new Error('Account IDs or emails are required') } return { ...baseParams, serviceDeskId: params.serviceDeskId, accountIds: params.accountIds, + emails: params.emails, } } case 'get_organizations': @@ -749,6 +750,10 @@ Return ONLY the comment text - no explanations.`, commentBody: { type: 'string', description: 'Comment text' }, isPublic: { type: 'string', description: 'Whether comment is public or internal' }, accountIds: { type: 'string', description: 'Comma-separated Atlassian account IDs' }, + emails: { + type: 'string', + description: 'Comma-separated email addresses', + }, customerQuery: { type: 'string', description: 'Customer search query' }, transitionId: { type: 'string', description: 'Transition ID' }, transitionComment: { type: 'string', description: 'Transition comment' }, @@ -799,6 +804,7 @@ Return ONLY the comment text - no explanations.`, transitionId: { type: 'string', description: 'Applied transition ID' }, participants: { type: 'json', description: 'Array of participants' }, approvals: { type: 'json', description: 'Array of approvals' }, + approval: { type: 'json', description: 'Approval object' }, approvalId: { type: 'string', description: 'Approval ID' }, decision: { type: 'string', description: 'Approval decision' }, total: { type: 'number', description: 'Total count' }, diff --git a/apps/sim/tools/jsm/add_customer.ts b/apps/sim/tools/jsm/add_customer.ts index 58c774c36..8edd1ddf2 100644 --- a/apps/sim/tools/jsm/add_customer.ts +++ b/apps/sim/tools/jsm/add_customer.ts @@ -39,10 +39,16 @@ export const jsmAddCustomerTool: ToolConfig url: string + request?: Record } } @@ -759,6 +761,7 @@ export interface JsmAnswerApprovalResponse extends ToolResponse { }> | null createdDate: { iso8601: string; friendly: string; epochMillis: number } | null completedDate: { iso8601: string; friendly: string; epochMillis: number } | null + approval?: Record success: boolean } }