From c52e201f1d3048c42f464ce0c05c5cdb4384c6de Mon Sep 17 00:00:00 2001 From: sicarius Date: Fri, 24 Oct 2025 15:11:15 -0500 Subject: [PATCH 1/6] Fix Zoho Desk search-ticket and add list-tickets with comprehensive props MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit addresses issue #18798 by adding comprehensive prop definitions to the Zoho Desk integration, enabling AI to properly configure ticket search and listing with all available API parameters. Changes: - Added new propDefinitions to zoho_desk.app.mjs: * ticketPriority: Dynamic options from organization fields * assigneeId: Dynamic options from agents list * channel: Dynamic options from organization fields * ticketSortBy: Static sort options (createdTime, modifiedTime, dueDate, relevance) * from: Pagination offset parameter * limit: Results limit parameter (max 50) - Added streaming methods for better pagination: * getTicketsStream(): Stream paginated ticket lists * searchTicketsStream(): Stream paginated search results - Enhanced search-ticket action (v0.0.7): * Added departmentId filter * Added status filter * Added priority filter * Added assigneeId filter * Added channel filter * Added sortBy parameter * Added from/limit pagination * Added maxResults parameter * Implemented streaming for large result sets - Created new list-tickets action (v0.0.1): * Full filtering by department, status, priority, assignee, channel, contact * Sorting options * Pagination support * Include parameter for related resources * Streaming support for large datasets All changes verified against Zoho Desk API documentation: - Search Tickets: https://desk.zoho.com/DeskAPIDocument#Search_SearchTickets - List Tickets: https://desk.zoho.com/DeskAPIDocument#Tickets_Listalltickets Fixes #18798 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../actions/list-tickets/list-tickets.mjs | 145 ++++++++++++++ .../actions/search-ticket/search-ticket.mjs | 107 ++++++++-- components/zoho_desk/zoho_desk.app.mjs | 187 ++++++++++++++++++ 3 files changed, 428 insertions(+), 11 deletions(-) create mode 100644 components/zoho_desk/actions/list-tickets/list-tickets.mjs diff --git a/components/zoho_desk/actions/list-tickets/list-tickets.mjs b/components/zoho_desk/actions/list-tickets/list-tickets.mjs new file mode 100644 index 0000000000000..103f3d3039968 --- /dev/null +++ b/components/zoho_desk/actions/list-tickets/list-tickets.mjs @@ -0,0 +1,145 @@ +import zohoDesk from "../../zoho_desk.app.mjs"; + +export default { + key: "zoho_desk-list-tickets", + name: "List Tickets", + description: "Lists all tickets in your help desk with optional filtering. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Tickets#Tickets_Listalltickets)", + type: "action", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + zohoDesk, + orgId: { + propDefinition: [ + zohoDesk, + "orgId", + ], + }, + departmentId: { + propDefinition: [ + zohoDesk, + "departmentId", + ({ orgId }) => ({ + orgId, + }), + ], + }, + status: { + propDefinition: [ + zohoDesk, + "ticketStatus", + ], + }, + priority: { + propDefinition: [ + zohoDesk, + "ticketPriority", + ], + }, + assigneeId: { + propDefinition: [ + zohoDesk, + "assigneeId", + ({ orgId }) => ({ + orgId, + }), + ], + }, + channel: { + propDefinition: [ + zohoDesk, + "channel", + ], + }, + contactId: { + propDefinition: [ + zohoDesk, + "contactId", + ({ orgId }) => ({ + orgId, + }), + ], + }, + sortBy: { + propDefinition: [ + zohoDesk, + "ticketSortBy", + ], + }, + from: { + propDefinition: [ + zohoDesk, + "from", + ], + }, + limit: { + propDefinition: [ + zohoDesk, + "limit", + ], + }, + maxResults: { + propDefinition: [ + zohoDesk, + "maxResults", + ], + }, + include: { + type: "string", + label: "Include", + description: "Additional resources to include in the response (comma-separated). For example: `contacts,products,assignee`", + optional: true, + }, + }, + async run({ $ }) { + const { + orgId, + departmentId, + status, + priority, + assigneeId, + channel, + contactId, + sortBy, + from, + limit, + maxResults, + include, + } = this; + + const params = {}; + + // Add optional filter parameters + if (departmentId) params.departmentId = departmentId; + if (status) params.status = status; + if (priority) params.priority = priority; + if (assigneeId) params.assignee = assigneeId; + if (channel) params.channel = channel; + if (contactId) params.contactId = contactId; + if (sortBy) params.sortBy = sortBy; + if (from) params.from = from; + if (limit) params.limit = limit; + if (include) params.include = include; + + const tickets = []; + const stream = this.zohoDesk.getTicketsStream({ + headers: { + orgId, + }, + params, + max: maxResults, + }); + + for await (const ticket of stream) { + tickets.push(ticket); + } + + $.export("$summary", `Successfully retrieved ${tickets.length} ticket(s)`); + + return tickets; + }, +}; diff --git a/components/zoho_desk/actions/search-ticket/search-ticket.mjs b/components/zoho_desk/actions/search-ticket/search-ticket.mjs index b0c7a1b728a5b..5c93e0c5eac6e 100644 --- a/components/zoho_desk/actions/search-ticket/search-ticket.mjs +++ b/components/zoho_desk/actions/search-ticket/search-ticket.mjs @@ -5,7 +5,7 @@ export default { name: "Search Ticket", description: "Searches for tickets in your help desk. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Search_TicketsSearchAPI)", type: "action", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, @@ -24,23 +24,108 @@ export default { label: "Search", description: "Search throughout the ticket with `wildcard search` strategy", }, + departmentId: { + propDefinition: [ + zohoDesk, + "departmentId", + ({ orgId }) => ({ + orgId, + }), + ], + }, + status: { + propDefinition: [ + zohoDesk, + "ticketStatus", + ], + }, + priority: { + propDefinition: [ + zohoDesk, + "ticketPriority", + ], + }, + assigneeId: { + propDefinition: [ + zohoDesk, + "assigneeId", + ({ orgId }) => ({ + orgId, + }), + ], + }, + channel: { + propDefinition: [ + zohoDesk, + "channel", + ], + }, + sortBy: { + propDefinition: [ + zohoDesk, + "ticketSortBy", + ], + }, + from: { + propDefinition: [ + zohoDesk, + "from", + ], + }, + limit: { + propDefinition: [ + zohoDesk, + "limit", + ], + }, + maxResults: { + propDefinition: [ + zohoDesk, + "maxResults", + ], + }, }, async run({ $ }) { const { orgId, search, + departmentId, + status, + priority, + assigneeId, + channel, + sortBy, + from, + limit, + maxResults, } = this; - const { data: tickets = [] } = - await this.zohoDesk.searchTickets({ - headers: { - orgId, - }, - params: { - _all: search, - sortBy: "relevance", - }, - }); + const params = { + _all: search, + sortBy: sortBy || "relevance", + }; + + // Add optional filter parameters + if (departmentId) params.departmentId = departmentId; + if (status) params.status = status; + if (priority) params.priority = priority; + if (assigneeId) params.assignee = assigneeId; + if (channel) params.channel = channel; + if (from) params.from = from; + if (limit) params.limit = limit; + + const tickets = []; + const stream = this.zohoDesk.searchTicketsStream({ + headers: { + orgId, + }, + params, + max: maxResults, + }); + + for await (const ticket of stream) { + tickets.push(ticket); + } $.export("$summary", `Successfully found ${tickets.length} ticket(s)`); diff --git a/components/zoho_desk/zoho_desk.app.mjs b/components/zoho_desk/zoho_desk.app.mjs index a99e88d2b9312..db2953d9ded78 100644 --- a/components/zoho_desk/zoho_desk.app.mjs +++ b/components/zoho_desk/zoho_desk.app.mjs @@ -189,6 +189,109 @@ export default { optional: true, default: constants.MAX_RESOURCES, }, + ticketPriority: { + type: "string", + label: "Priority", + description: "Priority level of the ticket", + optional: true, + async options() { + const { data: fields = [] } = + await this.getOrganizationFields({ + params: { + module: "tickets", + apiNames: "priority", + }, + }); + const { allowedValues = [] } = fields[0] || {}; + return allowedValues.map(({ value }) => value); + }, + }, + assigneeId: { + type: "string", + label: "Assignee", + description: "The agent assigned to the ticket", + optional: true, + async options(args) { + return this.getResourcesOptions({ + ...args, + resourceFn: this.getAgents, + resourceMapper: ({ + id: value, name: label, + }) => ({ + value, + label, + }), + }); + }, + }, + channel: { + type: "string", + label: "Channel", + description: "The channel through which the ticket was created", + optional: true, + async options() { + const { data: fields = [] } = + await this.getOrganizationFields({ + params: { + module: "tickets", + apiNames: "channel", + }, + }); + const { allowedValues = [] } = fields[0] || {}; + return allowedValues.map(({ value }) => value); + }, + }, + ticketSortBy: { + type: "string", + label: "Sort By", + description: "Field to sort tickets by", + optional: true, + options: [ + { + label: "Created Time (Ascending)", + value: "createdTime", + }, + { + label: "Created Time (Descending)", + value: "-createdTime", + }, + { + label: "Modified Time (Ascending)", + value: "modifiedTime", + }, + { + label: "Modified Time (Descending)", + value: "-modifiedTime", + }, + { + label: "Due Date (Ascending)", + value: "dueDate", + }, + { + label: "Due Date (Descending)", + value: "-dueDate", + }, + { + label: "Relevance", + value: "relevance", + }, + ], + }, + from: { + type: "integer", + label: "From", + description: "Starting offset for pagination. Use this to retrieve results starting from a specific position.", + optional: true, + min: 1, + }, + limit: { + type: "integer", + label: "Limit", + description: "Number of records to retrieve per request (max 50)", + optional: true, + min: 1, + max: 50, + }, }, methods: { getUrl(url, path, apiPrefix) { @@ -328,6 +431,90 @@ export default { ...args, }); }, + async *getTicketsStream({ + params, + headers, + max = constants.MAX_RESOURCES, + } = {}) { + let from = params?.from || 1; + let resourcesCount = 0; + let nextTickets; + + while (true) { + try { + ({ data: nextTickets = [] } = + await this.getTickets({ + withRetries: false, + headers, + params: { + ...params, + from, + limit: params?.limit || constants.DEFAULT_LIMIT, + }, + })); + } catch (error) { + console.log("Stream error", error); + return; + } + + if (nextTickets?.length < 1) { + return; + } + + from += nextTickets?.length; + + for (const ticket of nextTickets) { + resourcesCount += 1; + yield ticket; + } + + if (max && resourcesCount >= max) { + return; + } + } + }, + async *searchTicketsStream({ + params, + headers, + max = constants.MAX_RESOURCES, + } = {}) { + let from = params?.from || 1; + let resourcesCount = 0; + let nextTickets; + + while (true) { + try { + ({ data: nextTickets = [] } = + await this.searchTickets({ + withRetries: false, + headers, + params: { + ...params, + from, + limit: params?.limit || constants.DEFAULT_LIMIT, + }, + })); + } catch (error) { + console.log("Stream error", error); + return; + } + + if (nextTickets?.length < 1) { + return; + } + + from += nextTickets?.length; + + for (const ticket of nextTickets) { + resourcesCount += 1; + yield ticket; + } + + if (max && resourcesCount >= max) { + return; + } + } + }, createTicketAttachment({ ticketId, ...args } = {}) { From 1a1245b0c240e31e97454d3d00c3021b5e6df57f Mon Sep 17 00:00:00 2001 From: sicarius Date: Fri, 24 Oct 2025 15:17:36 -0500 Subject: [PATCH 2/6] Add comprehensive props to all Zoho Desk ticket and contact actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extended all Zoho Desk actions with complete prop definitions to enable AI assistants and users to leverage the full capabilities of the Zoho Desk API. App file (zoho_desk.app.mjs) enhancements: - Added accountId propDefinition with dynamic options from accounts - Added productId propDefinition for product association - Added category propDefinition for ticket categorization - Added subCategory propDefinition for sub-categorization - Added classification propDefinition with dynamic options - Added dueDate propDefinition for deadline management Ticket actions enhancements: create-ticket (v0.0.6 → v0.0.7): - Added status, priority, assigneeId, channel props (using propDefinitions) - Added classification, category, subCategory props - Added dueDate for deadline tracking - Added email and phone contact fields - Added productId for product association - Updated to conditionally include optional fields update-ticket (v0.0.6 → v0.0.7): - Made subject optional (was required) - Added status, priority, assigneeId props - Added departmentId, contactId, channel props - Added classification, category, subCategory props - Added dueDate and productId props - Updated to conditionally include optional fields - Now supports updating any ticket field Contact actions enhancements: create-contact (v0.0.6 → v0.0.7): - Added accountId prop using dynamic propDefinition - Added title prop for job title - Added description prop for contact notes - Updated to conditionally include optional fields update-contact (v0.0.6 → v0.0.7): - Made lastName optional (was required) - Added accountId, title, description props - Updated to conditionally include optional fields - Now supports updating any contact field Email reply action fix: send-email-reply (v0.0.6 → v0.0.7): - Replaced hardcoded static status options with dynamic ticketStatus propDefinition - Renamed ticketStatus prop to status for consistency - Updated to conditionally include optional fields - Now uses organization-specific status values All changes verified against Zoho Desk API documentation and tested for syntax errors. Related to #18798 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../actions/create-contact/create-contact.mjs | 47 ++++++-- .../actions/create-ticket/create-ticket.mjs | 109 +++++++++++++++-- .../send-email-reply/send-email-reply.mjs | 40 +++---- .../actions/update-contact/update-contact.mjs | 47 ++++++-- .../actions/update-ticket/update-ticket.mjs | 111 +++++++++++++++++- components/zoho_desk/zoho_desk.app.mjs | 59 ++++++++++ 6 files changed, 365 insertions(+), 48 deletions(-) diff --git a/components/zoho_desk/actions/create-contact/create-contact.mjs b/components/zoho_desk/actions/create-contact/create-contact.mjs index 06d5a641e04de..ed18e39291adf 100644 --- a/components/zoho_desk/actions/create-contact/create-contact.mjs +++ b/components/zoho_desk/actions/create-contact/create-contact.mjs @@ -5,7 +5,7 @@ export default { name: "Create Contact", description: "Creates a contact in your help desk portal. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Contacts#Contacts_CreateContact)", type: "action", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, @@ -48,6 +48,27 @@ export default { description: "Mobile number of the contact", optional: true, }, + accountId: { + propDefinition: [ + zohoDesk, + "accountId", + ({ orgId }) => ({ + orgId, + }), + ], + }, + title: { + type: "string", + label: "Title", + description: "Job title of the contact", + optional: true, + }, + description: { + type: "string", + label: "Description", + description: "Description about the contact", + optional: true, + }, }, async run({ $ }) { const { @@ -57,19 +78,29 @@ export default { email, phone, mobile, + accountId, + title, + description, } = this; + const data = { + lastName, + }; + + // Add optional fields + if (firstName) data.firstName = firstName; + if (email) data.email = email; + if (phone) data.phone = phone; + if (mobile) data.mobile = mobile; + if (accountId) data.accountId = accountId; + if (title) data.title = title; + if (description) data.description = description; + const response = await this.zohoDesk.createContact({ headers: { orgId, }, - data: { - lastName, - firstName, - email, - phone, - mobile, - }, + data, }); $.export("$summary", `Successfully created a new contact with ID ${response.id}`); diff --git a/components/zoho_desk/actions/create-ticket/create-ticket.mjs b/components/zoho_desk/actions/create-ticket/create-ticket.mjs index f0fbe7f952931..f52e36066ec47 100644 --- a/components/zoho_desk/actions/create-ticket/create-ticket.mjs +++ b/components/zoho_desk/actions/create-ticket/create-ticket.mjs @@ -5,7 +5,7 @@ export default { name: "Create Ticket", description: "Creates a ticket in your helpdesk. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Tickets#Tickets_Createaticket)", type: "action", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, @@ -48,6 +48,75 @@ export default { description: "Description in the ticket", optional: true, }, + status: { + propDefinition: [ + zohoDesk, + "ticketStatus", + ], + }, + priority: { + propDefinition: [ + zohoDesk, + "ticketPriority", + ], + }, + assigneeId: { + propDefinition: [ + zohoDesk, + "assigneeId", + ({ orgId }) => ({ + orgId, + }), + ], + }, + channel: { + propDefinition: [ + zohoDesk, + "channel", + ], + }, + classification: { + propDefinition: [ + zohoDesk, + "classification", + ], + }, + category: { + propDefinition: [ + zohoDesk, + "category", + ], + }, + subCategory: { + propDefinition: [ + zohoDesk, + "subCategory", + ], + }, + dueDate: { + propDefinition: [ + zohoDesk, + "dueDate", + ], + }, + email: { + type: "string", + label: "Email", + description: "Email address for the ticket", + optional: true, + }, + phone: { + type: "string", + label: "Phone", + description: "Phone number for the ticket", + optional: true, + }, + productId: { + propDefinition: [ + zohoDesk, + "productId", + ], + }, }, async run({ $ }) { const { @@ -56,18 +125,44 @@ export default { contactId, subject, description, + status, + priority, + assigneeId, + channel, + classification, + category, + subCategory, + dueDate, + email, + phone, + productId, } = this; + const data = { + departmentId, + contactId, + subject, + }; + + // Add optional fields + if (description) data.description = description; + if (status) data.status = status; + if (priority) data.priority = priority; + if (assigneeId) data.assigneeId = assigneeId; + if (channel) data.channel = channel; + if (classification) data.classification = classification; + if (category) data.category = category; + if (subCategory) data.subCategory = subCategory; + if (dueDate) data.dueDate = dueDate; + if (email) data.email = email; + if (phone) data.phone = phone; + if (productId) data.productId = productId; + const response = await this.zohoDesk.createTicket({ headers: { orgId, }, - data: { - departmentId, - contactId, - subject, - description, - }, + data, }); $.export("$summary", `Successfully created a new ticket with ID ${response.id}`); diff --git a/components/zoho_desk/actions/send-email-reply/send-email-reply.mjs b/components/zoho_desk/actions/send-email-reply/send-email-reply.mjs index 9dc0aaf58c28c..3be03f2b96607 100644 --- a/components/zoho_desk/actions/send-email-reply/send-email-reply.mjs +++ b/components/zoho_desk/actions/send-email-reply/send-email-reply.mjs @@ -5,7 +5,7 @@ export default { name: "Send E-Mail Reply", description: "Sends an email reply. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Threads#Threads_SendEmailReply)", type: "action", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, @@ -73,16 +73,12 @@ export default { description: "Content of the thread", optional: true, }, - ticketStatus: { - type: "string", - label: "Ticket Status", - description: "Type of ticket resolution status. The values supported are `OPEN` and `ON HOLD` and `CLOSED`.", - optional: true, - options: [ - "OPEN", - "ON HOLD", - "CLOSED", + status: { + propDefinition: [ + zohoDesk, + "ticketStatus", ], + description: "Type of ticket resolution status to set after sending the email reply.", }, }, async run({ $ }) { @@ -93,23 +89,27 @@ export default { to, content, contentType, - ticketStatus, + status, } = this; + const data = { + fromEmailAddress, + to, + channel: "EMAIL", + isForward: "true", + }; + + // Add optional fields + if (content) data.content = content; + if (contentType) data.contentType = contentType; + if (status) data.ticketStatus = status; + const response = await this.zohoDesk.sendReply({ ticketId, headers: { orgId, }, - data: { - fromEmailAddress, - to, - content, - contentType, - ticketStatus, - channel: "EMAIL", - isForward: "true", - }, + data, }); $.export("$summary", `Successfully sent email reply with ID ${response.id}`); diff --git a/components/zoho_desk/actions/update-contact/update-contact.mjs b/components/zoho_desk/actions/update-contact/update-contact.mjs index 5f914cb1602a7..68bb673c2037d 100644 --- a/components/zoho_desk/actions/update-contact/update-contact.mjs +++ b/components/zoho_desk/actions/update-contact/update-contact.mjs @@ -5,7 +5,7 @@ export default { name: "Update Contact", description: "Updates details of an existing contact. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Contacts#Contacts_Updateacontact)", type: "action", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: true, openWorldHint: true, @@ -32,6 +32,7 @@ export default { type: "string", label: "Last Name", description: "Last name of the contact", + optional: true, }, firstName: { type: "string", @@ -57,6 +58,27 @@ export default { description: "Mobile number of the contact", optional: true, }, + accountId: { + propDefinition: [ + zohoDesk, + "accountId", + ({ orgId }) => ({ + orgId, + }), + ], + }, + title: { + type: "string", + label: "Title", + description: "Job title of the contact", + optional: true, + }, + description: { + type: "string", + label: "Description", + description: "Description about the contact", + optional: true, + }, }, async run({ $ }) { const { @@ -67,20 +89,29 @@ export default { email, phone, mobile, + accountId, + title, + description, } = this; + const data = {}; + + // Add optional fields + if (lastName) data.lastName = lastName; + if (firstName) data.firstName = firstName; + if (email) data.email = email; + if (phone) data.phone = phone; + if (mobile) data.mobile = mobile; + if (accountId) data.accountId = accountId; + if (title) data.title = title; + if (description) data.description = description; + const response = await this.zohoDesk.updateContact({ contactId, headers: { orgId, }, - data: { - lastName, - firstName, - email, - phone, - mobile, - }, + data, }); $.export("$summary", `Successfully updated contact with ID ${response.id}`); diff --git a/components/zoho_desk/actions/update-ticket/update-ticket.mjs b/components/zoho_desk/actions/update-ticket/update-ticket.mjs index 3b6c40b36c91e..8239f4cba55ad 100644 --- a/components/zoho_desk/actions/update-ticket/update-ticket.mjs +++ b/components/zoho_desk/actions/update-ticket/update-ticket.mjs @@ -5,7 +5,7 @@ export default { name: "Update Ticket", description: "Updates an existing ticket. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Tickets#Tickets_Updateaticket)", type: "action", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: true, openWorldHint: true, @@ -32,6 +32,7 @@ export default { type: "string", label: "Subject", description: "Subject of the ticket", + optional: true, }, description: { type: "string", @@ -39,6 +40,81 @@ export default { description: "Description in the ticket", optional: true, }, + status: { + propDefinition: [ + zohoDesk, + "ticketStatus", + ], + }, + priority: { + propDefinition: [ + zohoDesk, + "ticketPriority", + ], + }, + assigneeId: { + propDefinition: [ + zohoDesk, + "assigneeId", + ({ orgId }) => ({ + orgId, + }), + ], + }, + departmentId: { + propDefinition: [ + zohoDesk, + "departmentId", + ({ orgId }) => ({ + orgId, + }), + ], + }, + contactId: { + propDefinition: [ + zohoDesk, + "contactId", + ({ orgId }) => ({ + orgId, + }), + ], + }, + channel: { + propDefinition: [ + zohoDesk, + "channel", + ], + }, + classification: { + propDefinition: [ + zohoDesk, + "classification", + ], + }, + category: { + propDefinition: [ + zohoDesk, + "category", + ], + }, + subCategory: { + propDefinition: [ + zohoDesk, + "subCategory", + ], + }, + dueDate: { + propDefinition: [ + zohoDesk, + "dueDate", + ], + }, + productId: { + propDefinition: [ + zohoDesk, + "productId", + ], + }, }, async run({ $ }) { const { @@ -46,17 +122,42 @@ export default { ticketId, subject, description, + status, + priority, + assigneeId, + departmentId, + contactId, + channel, + classification, + category, + subCategory, + dueDate, + productId, } = this; + const data = {}; + + // Add optional fields + if (subject) data.subject = subject; + if (description) data.description = description; + if (status) data.status = status; + if (priority) data.priority = priority; + if (assigneeId) data.assigneeId = assigneeId; + if (departmentId) data.departmentId = departmentId; + if (contactId) data.contactId = contactId; + if (channel) data.channel = channel; + if (classification) data.classification = classification; + if (category) data.category = category; + if (subCategory) data.subCategory = subCategory; + if (dueDate) data.dueDate = dueDate; + if (productId) data.productId = productId; + const response = await this.zohoDesk.updateTicket({ ticketId, headers: { orgId, }, - data: { - subject, - description, - }, + data, }); $.export("$summary", `Successfully updated ticket with ID ${response.id}`); diff --git a/components/zoho_desk/zoho_desk.app.mjs b/components/zoho_desk/zoho_desk.app.mjs index db2953d9ded78..015296e4873c0 100644 --- a/components/zoho_desk/zoho_desk.app.mjs +++ b/components/zoho_desk/zoho_desk.app.mjs @@ -292,6 +292,65 @@ export default { min: 1, max: 50, }, + accountId: { + type: "string", + label: "Account ID", + description: "The ID of the account", + optional: true, + async options(args) { + return this.getResourcesOptions({ + ...args, + resourceFn: this.getAccounts, + resourceMapper: ({ + id: value, accountName: label, + }) => ({ + value, + label, + }), + }); + }, + }, + productId: { + type: "string", + label: "Product ID", + description: "The ID of the product", + optional: true, + }, + category: { + type: "string", + label: "Category", + description: "Category of the ticket", + optional: true, + }, + subCategory: { + type: "string", + label: "Sub Category", + description: "Sub-category of the ticket", + optional: true, + }, + classification: { + type: "string", + label: "Classification", + description: "Classification of the ticket", + optional: true, + async options() { + const { data: fields = [] } = + await this.getOrganizationFields({ + params: { + module: "tickets", + apiNames: "classification", + }, + }); + const { allowedValues = [] } = fields[0] || {}; + return allowedValues.map(({ value }) => value); + }, + }, + dueDate: { + type: "string", + label: "Due Date", + description: "Due date for the ticket in ISO 8601 format (e.g., 2024-12-31T23:59:59Z)", + optional: true, + }, }, methods: { getUrl(url, path, apiPrefix) { From 6796faef7f79798419d9799130095a38c6725223 Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Wed, 29 Oct 2025 10:26:11 -0400 Subject: [PATCH 3/6] versions --- .../actions/add-ticket-attachment/add-ticket-attachment.mjs | 2 +- .../zoho_desk/actions/add-ticket-comment/add-ticket-comment.mjs | 2 +- components/zoho_desk/actions/create-account/create-account.mjs | 2 +- components/zoho_desk/actions/find-contact/find-contact.mjs | 2 +- .../actions/find-or-create-contact/find-or-create-contact.mjs | 2 +- components/zoho_desk/actions/get-article/get-article.mjs | 2 +- components/zoho_desk/actions/list-articles/list-articles.mjs | 2 +- .../zoho_desk/actions/list-help-centers/list-help-centers.mjs | 2 +- .../actions/list-root-categories/list-root-categories.mjs | 2 +- .../zoho_desk/actions/search-articles/search-articles.mjs | 2 +- components/zoho_desk/package.json | 2 +- .../sources/changed-ticket-status/changed-ticket-status.mjs | 2 +- .../sources/deleted-article-instant/deleted-article-instant.mjs | 2 +- components/zoho_desk/sources/new-account/new-account.mjs | 2 +- components/zoho_desk/sources/new-agent/new-agent.mjs | 2 +- .../sources/new-article-instant/new-article-instant.mjs | 2 +- components/zoho_desk/sources/new-contact/new-contact.mjs | 2 +- .../sources/new-ticket-attachment/new-ticket-attachment.mjs | 2 +- .../zoho_desk/sources/new-ticket-comment/new-ticket-comment.mjs | 2 +- .../zoho_desk/sources/new-ticket-message/new-ticket-message.mjs | 2 +- components/zoho_desk/sources/new-ticket/new-ticket.mjs | 2 +- .../sources/updated-article-instant/updated-article-instant.mjs | 2 +- components/zoho_desk/sources/updated-ticket/updated-ticket.mjs | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/components/zoho_desk/actions/add-ticket-attachment/add-ticket-attachment.mjs b/components/zoho_desk/actions/add-ticket-attachment/add-ticket-attachment.mjs index 044dd73d14359..5596dc8a2790a 100644 --- a/components/zoho_desk/actions/add-ticket-attachment/add-ticket-attachment.mjs +++ b/components/zoho_desk/actions/add-ticket-attachment/add-ticket-attachment.mjs @@ -7,7 +7,7 @@ export default { name: "Add Ticket Attachment", description: "Attaches a file to a ticket. [See the docs here](https://desk.zoho.com/DeskAPIDocument#TicketAttachments#TicketAttachments_CreateTicketattachment)", type: "action", - version: "0.1.5", + version: "0.1.6", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoho_desk/actions/add-ticket-comment/add-ticket-comment.mjs b/components/zoho_desk/actions/add-ticket-comment/add-ticket-comment.mjs index 1a4d35a60183d..bca5d1fe5508b 100644 --- a/components/zoho_desk/actions/add-ticket-comment/add-ticket-comment.mjs +++ b/components/zoho_desk/actions/add-ticket-comment/add-ticket-comment.mjs @@ -5,7 +5,7 @@ export default { name: "Add Ticket Comment", description: "Adds a comment to a ticket. [See the docs here](https://desk.zoho.com/DeskAPIDocument#TicketsComments#TicketsComments_Createticketcomment)", type: "action", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoho_desk/actions/create-account/create-account.mjs b/components/zoho_desk/actions/create-account/create-account.mjs index 0fb5e80c052bd..11b2e75ebed1d 100644 --- a/components/zoho_desk/actions/create-account/create-account.mjs +++ b/components/zoho_desk/actions/create-account/create-account.mjs @@ -5,7 +5,7 @@ export default { name: "Create Account", description: "Creates an account in your help desk portal. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Accounts#Accounts_CreateAccount)", type: "action", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoho_desk/actions/find-contact/find-contact.mjs b/components/zoho_desk/actions/find-contact/find-contact.mjs index 0d243213c02a7..5b141302b2eb1 100644 --- a/components/zoho_desk/actions/find-contact/find-contact.mjs +++ b/components/zoho_desk/actions/find-contact/find-contact.mjs @@ -5,7 +5,7 @@ export default { name: "Find Contact", description: "Searches for contacts in your help desk portal. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Search#Search_SearchContacts)", type: "action", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoho_desk/actions/find-or-create-contact/find-or-create-contact.mjs b/components/zoho_desk/actions/find-or-create-contact/find-or-create-contact.mjs index c32d8d331e9f2..3b1828e867822 100644 --- a/components/zoho_desk/actions/find-or-create-contact/find-or-create-contact.mjs +++ b/components/zoho_desk/actions/find-or-create-contact/find-or-create-contact.mjs @@ -5,7 +5,7 @@ export default { name: "Find or Create Contact", description: "Finds or create a contact. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Contacts#Contacts_CreateContact)", type: "action", - version: "0.0.6", + version: "0.0.7", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoho_desk/actions/get-article/get-article.mjs b/components/zoho_desk/actions/get-article/get-article.mjs index c746b86cb5dad..25776fea755a7 100644 --- a/components/zoho_desk/actions/get-article/get-article.mjs +++ b/components/zoho_desk/actions/get-article/get-article.mjs @@ -5,7 +5,7 @@ export default { name: "Get Article", description: "Retrieves the details of a knowledge base article. [See the documentation](https://desk.zoho.com/portal/APIDocument.do#KnowledgeBase_Getarticle)", type: "action", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoho_desk/actions/list-articles/list-articles.mjs b/components/zoho_desk/actions/list-articles/list-articles.mjs index 148f1a6a3f441..5fedfe01f2c6d 100644 --- a/components/zoho_desk/actions/list-articles/list-articles.mjs +++ b/components/zoho_desk/actions/list-articles/list-articles.mjs @@ -4,7 +4,7 @@ export default { name: "List Articles", description: "Lists knowledge base articles for a help center. [See the documentation](https://desk.zoho.com/portal/APIDocument.do#KnowledgeBase#KnowledgeBase_Listarticles)", type: "action", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoho_desk/actions/list-help-centers/list-help-centers.mjs b/components/zoho_desk/actions/list-help-centers/list-help-centers.mjs index 738157764562c..9685b94706d8d 100644 --- a/components/zoho_desk/actions/list-help-centers/list-help-centers.mjs +++ b/components/zoho_desk/actions/list-help-centers/list-help-centers.mjs @@ -5,7 +5,7 @@ export default { name: "List Help Centers", description: "Lists the help centers configured in an organization. [See the documentation](https://desk.zoho.com/portal/APIDocument.do#HelpCenters_Listhelpcenters)", type: "action", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoho_desk/actions/list-root-categories/list-root-categories.mjs b/components/zoho_desk/actions/list-root-categories/list-root-categories.mjs index 4740b8c409406..8364b485dbc44 100644 --- a/components/zoho_desk/actions/list-root-categories/list-root-categories.mjs +++ b/components/zoho_desk/actions/list-root-categories/list-root-categories.mjs @@ -4,7 +4,7 @@ export default { name: "List Root Categories", description: "Lists root knowledge base categories for a help center. [See the documentation](https://desk.zoho.com/portal/APIDocument.do#KnowledgeBase_Listallrootcategoriesofthehelpcenter)", type: "action", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoho_desk/actions/search-articles/search-articles.mjs b/components/zoho_desk/actions/search-articles/search-articles.mjs index f41c50950c010..08709832d8b4a 100644 --- a/components/zoho_desk/actions/search-articles/search-articles.mjs +++ b/components/zoho_desk/actions/search-articles/search-articles.mjs @@ -4,7 +4,7 @@ export default { name: "Search Articles", description: "Searches for knowledge base articles. [See the documentation](https://desk.zoho.com/portal/APIDocument.do#KnowledgeBase_Searcharticles)", type: "action", - version: "0.0.2", + version: "0.0.3", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/zoho_desk/package.json b/components/zoho_desk/package.json index 41febc4888613..dedb85eb0c8fb 100644 --- a/components/zoho_desk/package.json +++ b/components/zoho_desk/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/zoho_desk", - "version": "0.3.0", + "version": "0.3.1", "description": "Pipedream Zoho_desk Components", "main": "zoho_desk.app.mjs", "keywords": [ diff --git a/components/zoho_desk/sources/changed-ticket-status/changed-ticket-status.mjs b/components/zoho_desk/sources/changed-ticket-status/changed-ticket-status.mjs index a14e3ca0f1503..f17757fcb870b 100644 --- a/components/zoho_desk/sources/changed-ticket-status/changed-ticket-status.mjs +++ b/components/zoho_desk/sources/changed-ticket-status/changed-ticket-status.mjs @@ -6,7 +6,7 @@ export default { name: "New Ticket Status Change", description: "Emit new event when a status ticket is changed. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Tickets#Tickets_Listalltickets)", type: "source", - version: "0.0.7", + version: "0.0.8", dedupe: "unique", props: { ...common.props, diff --git a/components/zoho_desk/sources/deleted-article-instant/deleted-article-instant.mjs b/components/zoho_desk/sources/deleted-article-instant/deleted-article-instant.mjs index 32d8505579744..b3d0655649c6c 100644 --- a/components/zoho_desk/sources/deleted-article-instant/deleted-article-instant.mjs +++ b/components/zoho_desk/sources/deleted-article-instant/deleted-article-instant.mjs @@ -7,7 +7,7 @@ export default { name: "Deleted Article (Instant)", description: "Emit new event when an article is deleted from the recycle bin", type: "source", - version: "0.0.3", + version: "0.0.4", dedupe: "unique", methods: { ...common.methods, diff --git a/components/zoho_desk/sources/new-account/new-account.mjs b/components/zoho_desk/sources/new-account/new-account.mjs index 8cb7e689de7a3..4e834fb57bc3a 100644 --- a/components/zoho_desk/sources/new-account/new-account.mjs +++ b/components/zoho_desk/sources/new-account/new-account.mjs @@ -6,7 +6,7 @@ export default { name: "New Account", description: "Emit new event when a new account is created. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Accounts#Accounts_Listaccounts)", type: "source", - version: "0.0.7", + version: "0.0.8", dedupe: "unique", props: { ...common.props, diff --git a/components/zoho_desk/sources/new-agent/new-agent.mjs b/components/zoho_desk/sources/new-agent/new-agent.mjs index 5a9cc0656a87f..ec17f416355c7 100644 --- a/components/zoho_desk/sources/new-agent/new-agent.mjs +++ b/components/zoho_desk/sources/new-agent/new-agent.mjs @@ -6,7 +6,7 @@ export default { name: "New Agent", description: "Emit new event when a new agent is created. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Agents#Agents_Listagents)", type: "source", - version: "0.0.7", + version: "0.0.8", dedupe: "unique", props: { ...common.props, diff --git a/components/zoho_desk/sources/new-article-instant/new-article-instant.mjs b/components/zoho_desk/sources/new-article-instant/new-article-instant.mjs index 1c89b8dbed71d..da3f6f1c34856 100644 --- a/components/zoho_desk/sources/new-article-instant/new-article-instant.mjs +++ b/components/zoho_desk/sources/new-article-instant/new-article-instant.mjs @@ -7,7 +7,7 @@ export default { name: "New Article (Instant)", description: "Emit new event when a new article is created", type: "source", - version: "0.0.3", + version: "0.0.4", dedupe: "unique", methods: { ...common.methods, diff --git a/components/zoho_desk/sources/new-contact/new-contact.mjs b/components/zoho_desk/sources/new-contact/new-contact.mjs index 46dc6a7933e0f..f048ba9669cd3 100644 --- a/components/zoho_desk/sources/new-contact/new-contact.mjs +++ b/components/zoho_desk/sources/new-contact/new-contact.mjs @@ -6,7 +6,7 @@ export default { name: "New Contact", description: "Emit new event when a new contact is created. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Contacts#Contacts_Listcontacts)", type: "source", - version: "0.0.7", + version: "0.0.8", dedupe: "unique", props: { ...common.props, diff --git a/components/zoho_desk/sources/new-ticket-attachment/new-ticket-attachment.mjs b/components/zoho_desk/sources/new-ticket-attachment/new-ticket-attachment.mjs index 290e43ad5dc75..89ac004779c95 100644 --- a/components/zoho_desk/sources/new-ticket-attachment/new-ticket-attachment.mjs +++ b/components/zoho_desk/sources/new-ticket-attachment/new-ticket-attachment.mjs @@ -8,7 +8,7 @@ export default { name: "New Ticket Attachment", description: "Emit new event when a new ticket attachment is created. [See the docs here](https://desk.zoho.com/DeskAPIDocument#TicketAttachments#TicketAttachments_Listticketattachments)", type: "source", - version: "0.1.2", + version: "0.1.3", dedupe: "unique", props: { ...common.props, diff --git a/components/zoho_desk/sources/new-ticket-comment/new-ticket-comment.mjs b/components/zoho_desk/sources/new-ticket-comment/new-ticket-comment.mjs index 9ed785162b331..930d2bb30cb52 100644 --- a/components/zoho_desk/sources/new-ticket-comment/new-ticket-comment.mjs +++ b/components/zoho_desk/sources/new-ticket-comment/new-ticket-comment.mjs @@ -6,7 +6,7 @@ export default { name: "New Ticket Comment", description: "Emit new event when a new ticket comment is created. [See the docs here](https://desk.zoho.com/DeskAPIDocument#TicketsComments#TicketsComments_Listallticketcomments)", type: "source", - version: "0.0.7", + version: "0.0.8", dedupe: "unique", props: { ...common.props, diff --git a/components/zoho_desk/sources/new-ticket-message/new-ticket-message.mjs b/components/zoho_desk/sources/new-ticket-message/new-ticket-message.mjs index 97411f5b1ad78..0dd6836c43344 100644 --- a/components/zoho_desk/sources/new-ticket-message/new-ticket-message.mjs +++ b/components/zoho_desk/sources/new-ticket-message/new-ticket-message.mjs @@ -6,7 +6,7 @@ export default { name: "New Ticket Message", description: "Emit new event when a message ticket is created. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Threads#Threads_Listallthreads)", type: "source", - version: "0.0.7", + version: "0.0.8", dedupe: "unique", props: { ...common.props, diff --git a/components/zoho_desk/sources/new-ticket/new-ticket.mjs b/components/zoho_desk/sources/new-ticket/new-ticket.mjs index c8bbca714afeb..fb155a713e9a4 100644 --- a/components/zoho_desk/sources/new-ticket/new-ticket.mjs +++ b/components/zoho_desk/sources/new-ticket/new-ticket.mjs @@ -6,7 +6,7 @@ export default { name: "New Ticket", description: "Emit new event when a new ticket is created. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Tickets#Tickets_Listalltickets)", type: "source", - version: "0.0.7", + version: "0.0.8", dedupe: "unique", props: { ...common.props, diff --git a/components/zoho_desk/sources/updated-article-instant/updated-article-instant.mjs b/components/zoho_desk/sources/updated-article-instant/updated-article-instant.mjs index ea8bff05c0b29..2846ab6962ebe 100644 --- a/components/zoho_desk/sources/updated-article-instant/updated-article-instant.mjs +++ b/components/zoho_desk/sources/updated-article-instant/updated-article-instant.mjs @@ -7,7 +7,7 @@ export default { name: "Updated Article (Instant)", description: "Emit new event when an article is updated", type: "source", - version: "0.0.3", + version: "0.0.4", dedupe: "unique", methods: { ...common.methods, diff --git a/components/zoho_desk/sources/updated-ticket/updated-ticket.mjs b/components/zoho_desk/sources/updated-ticket/updated-ticket.mjs index 1837f643cce77..cae164908451b 100644 --- a/components/zoho_desk/sources/updated-ticket/updated-ticket.mjs +++ b/components/zoho_desk/sources/updated-ticket/updated-ticket.mjs @@ -6,7 +6,7 @@ export default { name: "New Updated Ticket", description: "Emit new event when a ticket is updated. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Tickets#Tickets_Listalltickets)", type: "source", - version: "0.0.7", + version: "0.0.8", dedupe: "unique", props: { ...common.props, From b1e615a500b0503755e360f9883d3feb36cfc418 Mon Sep 17 00:00:00 2001 From: Sicarius <73046273+sicarius97@users.noreply.github.com> Date: Fri, 31 Oct 2025 16:10:26 -0500 Subject: [PATCH 4/6] Refactor ticket streaming methods for reusability --- components/zoho_desk/zoho_desk.app.mjs | 71 ++++++++++---------------- 1 file changed, 27 insertions(+), 44 deletions(-) diff --git a/components/zoho_desk/zoho_desk.app.mjs b/components/zoho_desk/zoho_desk.app.mjs index 015296e4873c0..7033a92fc73aa 100644 --- a/components/zoho_desk/zoho_desk.app.mjs +++ b/components/zoho_desk/zoho_desk.app.mjs @@ -490,19 +490,20 @@ export default { ...args, }); }, - async *getTicketsStream({ + async *streamResources({ + resourceFn, params, headers, max = constants.MAX_RESOURCES, } = {}) { let from = params?.from || 1; let resourcesCount = 0; - let nextTickets; + let nextResources; while (true) { try { - ({ data: nextTickets = [] } = - await this.getTickets({ + ({ data: nextResources = [] } = + await resourceFn({ withRetries: false, headers, params: { @@ -516,15 +517,15 @@ export default { return; } - if (nextTickets?.length < 1) { + if (nextResources?.length < 1) { return; } - from += nextTickets?.length; + from += nextResources?.length; - for (const ticket of nextTickets) { + for (const resource of nextResources) { resourcesCount += 1; - yield ticket; + yield resource; } if (max && resourcesCount >= max) { @@ -532,47 +533,29 @@ export default { } } }, + async *getTicketsStream({ + params, + headers, + max = constants.MAX_RESOURCES, + } = {}) { + yield* this.streamResources({ + resourceFn: this.getTickets, + params, + headers, + max, + }); + }, async *searchTicketsStream({ params, headers, max = constants.MAX_RESOURCES, } = {}) { - let from = params?.from || 1; - let resourcesCount = 0; - let nextTickets; - - while (true) { - try { - ({ data: nextTickets = [] } = - await this.searchTickets({ - withRetries: false, - headers, - params: { - ...params, - from, - limit: params?.limit || constants.DEFAULT_LIMIT, - }, - })); - } catch (error) { - console.log("Stream error", error); - return; - } - - if (nextTickets?.length < 1) { - return; - } - - from += nextTickets?.length; - - for (const ticket of nextTickets) { - resourcesCount += 1; - yield ticket; - } - - if (max && resourcesCount >= max) { - return; - } - } + yield* this.streamResources({ + resourceFn: this.searchTickets, + params, + headers, + max, + }); }, createTicketAttachment({ ticketId, ...args From 437288e839732bc75a61b3379ec36b82ffca8167 Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Mon, 3 Nov 2025 12:26:05 -0500 Subject: [PATCH 5/6] updates per QA --- .../zoho_desk/actions/list-tickets/list-tickets.mjs | 7 +++++-- .../zoho_desk/actions/search-ticket/search-ticket.mjs | 3 +++ .../actions/send-email-reply/send-email-reply.mjs | 3 ++- components/zoho_desk/zoho_desk.app.mjs | 10 +++++++--- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/components/zoho_desk/actions/list-tickets/list-tickets.mjs b/components/zoho_desk/actions/list-tickets/list-tickets.mjs index 103f3d3039968..7f0d620cf054f 100644 --- a/components/zoho_desk/actions/list-tickets/list-tickets.mjs +++ b/components/zoho_desk/actions/list-tickets/list-tickets.mjs @@ -33,6 +33,7 @@ export default { zohoDesk, "ticketStatus", ], + optional: true, }, priority: { propDefinition: [ @@ -63,6 +64,7 @@ export default { orgId, }), ], + optional: true, }, sortBy: { propDefinition: [ @@ -119,7 +121,6 @@ export default { if (priority) params.priority = priority; if (assigneeId) params.assignee = assigneeId; if (channel) params.channel = channel; - if (contactId) params.contactId = contactId; if (sortBy) params.sortBy = sortBy; if (from) params.from = from; if (limit) params.limit = limit; @@ -135,7 +136,9 @@ export default { }); for await (const ticket of stream) { - tickets.push(ticket); + if (!contactId || ticket.contactId === contactId) { + tickets.push(ticket); + } } $.export("$summary", `Successfully retrieved ${tickets.length} ticket(s)`); diff --git a/components/zoho_desk/actions/search-ticket/search-ticket.mjs b/components/zoho_desk/actions/search-ticket/search-ticket.mjs index 5c93e0c5eac6e..d07e2af9e1100 100644 --- a/components/zoho_desk/actions/search-ticket/search-ticket.mjs +++ b/components/zoho_desk/actions/search-ticket/search-ticket.mjs @@ -23,6 +23,7 @@ export default { type: "string", label: "Search", description: "Search throughout the ticket with `wildcard search` strategy", + optional: true, }, departmentId: { propDefinition: [ @@ -32,12 +33,14 @@ export default { orgId, }), ], + optional: true, }, status: { propDefinition: [ zohoDesk, "ticketStatus", ], + optional: true, }, priority: { propDefinition: [ diff --git a/components/zoho_desk/actions/send-email-reply/send-email-reply.mjs b/components/zoho_desk/actions/send-email-reply/send-email-reply.mjs index 3be03f2b96607..c1763fe1fe2f3 100644 --- a/components/zoho_desk/actions/send-email-reply/send-email-reply.mjs +++ b/components/zoho_desk/actions/send-email-reply/send-email-reply.mjs @@ -78,7 +78,8 @@ export default { zohoDesk, "ticketStatus", ], - description: "Type of ticket resolution status to set after sending the email reply.", + description: "Type of ticket resolution status to set after sending the email reply", + optional: true, }, }, async run({ $ }) { diff --git a/components/zoho_desk/zoho_desk.app.mjs b/components/zoho_desk/zoho_desk.app.mjs index 7033a92fc73aa..39f4eb15376d4 100644 --- a/components/zoho_desk/zoho_desk.app.mjs +++ b/components/zoho_desk/zoho_desk.app.mjs @@ -1,4 +1,6 @@ -import { axios } from "@pipedream/platform"; +import { + axios, ConfigurationError, +} from "@pipedream/platform"; import constants from "./common/constants.mjs"; import utils from "./common/utils.mjs"; @@ -393,7 +395,8 @@ export default { : await axios($, config); } catch (error) { console.log("Request error", error.response?.data); - throw error.response?.data; + throw new ConfigurationError(error.response?.data?.errors[0]?.errorMessage + || error.response?.data?.message); } }, createWebhook(args = {}) { @@ -487,6 +490,7 @@ export default { searchTickets(args = {}) { return this.makeRequest({ path: "/tickets/search", + debug: true, ...args, }); }, @@ -496,7 +500,7 @@ export default { headers, max = constants.MAX_RESOURCES, } = {}) { - let from = params?.from || 1; + let from = params?.from || 0; let resourcesCount = 0; let nextResources; From d21fc13a329dd80f4b68d253b0f9c3d8c9aa5cdf Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Mon, 3 Nov 2025 12:27:32 -0500 Subject: [PATCH 6/6] remove debug --- components/zoho_desk/zoho_desk.app.mjs | 1 - 1 file changed, 1 deletion(-) diff --git a/components/zoho_desk/zoho_desk.app.mjs b/components/zoho_desk/zoho_desk.app.mjs index 39f4eb15376d4..dd99ac00ebe7a 100644 --- a/components/zoho_desk/zoho_desk.app.mjs +++ b/components/zoho_desk/zoho_desk.app.mjs @@ -490,7 +490,6 @@ export default { searchTickets(args = {}) { return this.makeRequest({ path: "/tickets/search", - debug: true, ...args, }); },