Skip to content

Commit 5ffba81

Browse files
sicarius97claudemichelle0927
authored
Merging pull request #18881
* Fix Zoho Desk search-ticket and add list-tickets with comprehensive props 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 <noreply@anthropic.com> * Add comprehensive props to all Zoho Desk ticket and contact actions 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 <noreply@anthropic.com> * versions * Refactor ticket streaming methods for reusability * updates per QA * remove debug --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Michelle Bergeron <michelle.bergeron@gmail.com>
1 parent 474fae1 commit 5ffba81

File tree

31 files changed

+811
-84
lines changed

31 files changed

+811
-84
lines changed

components/zoho_desk/actions/add-ticket-attachment/add-ticket-attachment.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
name: "Add Ticket Attachment",
88
description: "Attaches a file to a ticket. [See the docs here](https://desk.zoho.com/DeskAPIDocument#TicketAttachments#TicketAttachments_CreateTicketattachment)",
99
type: "action",
10-
version: "0.1.5",
10+
version: "0.1.6",
1111
annotations: {
1212
destructiveHint: false,
1313
openWorldHint: true,

components/zoho_desk/actions/add-ticket-comment/add-ticket-comment.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Add Ticket Comment",
66
description: "Adds a comment to a ticket. [See the docs here](https://desk.zoho.com/DeskAPIDocument#TicketsComments#TicketsComments_Createticketcomment)",
77
type: "action",
8-
version: "0.0.6",
8+
version: "0.0.7",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/zoho_desk/actions/create-account/create-account.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Create Account",
66
description: "Creates an account in your help desk portal. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Accounts#Accounts_CreateAccount)",
77
type: "action",
8-
version: "0.0.6",
8+
version: "0.0.7",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/zoho_desk/actions/create-contact/create-contact.mjs

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Create Contact",
66
description: "Creates a contact in your help desk portal. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Contacts#Contacts_CreateContact)",
77
type: "action",
8-
version: "0.0.6",
8+
version: "0.0.7",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,
@@ -48,6 +48,27 @@ export default {
4848
description: "Mobile number of the contact",
4949
optional: true,
5050
},
51+
accountId: {
52+
propDefinition: [
53+
zohoDesk,
54+
"accountId",
55+
({ orgId }) => ({
56+
orgId,
57+
}),
58+
],
59+
},
60+
title: {
61+
type: "string",
62+
label: "Title",
63+
description: "Job title of the contact",
64+
optional: true,
65+
},
66+
description: {
67+
type: "string",
68+
label: "Description",
69+
description: "Description about the contact",
70+
optional: true,
71+
},
5172
},
5273
async run({ $ }) {
5374
const {
@@ -57,19 +78,29 @@ export default {
5778
email,
5879
phone,
5980
mobile,
81+
accountId,
82+
title,
83+
description,
6084
} = this;
6185

86+
const data = {
87+
lastName,
88+
};
89+
90+
// Add optional fields
91+
if (firstName) data.firstName = firstName;
92+
if (email) data.email = email;
93+
if (phone) data.phone = phone;
94+
if (mobile) data.mobile = mobile;
95+
if (accountId) data.accountId = accountId;
96+
if (title) data.title = title;
97+
if (description) data.description = description;
98+
6299
const response = await this.zohoDesk.createContact({
63100
headers: {
64101
orgId,
65102
},
66-
data: {
67-
lastName,
68-
firstName,
69-
email,
70-
phone,
71-
mobile,
72-
},
103+
data,
73104
});
74105

75106
$.export("$summary", `Successfully created a new contact with ID ${response.id}`);

components/zoho_desk/actions/create-ticket/create-ticket.mjs

Lines changed: 102 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Create Ticket",
66
description: "Creates a ticket in your helpdesk. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Tickets#Tickets_Createaticket)",
77
type: "action",
8-
version: "0.0.6",
8+
version: "0.0.7",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,
@@ -48,6 +48,75 @@ export default {
4848
description: "Description in the ticket",
4949
optional: true,
5050
},
51+
status: {
52+
propDefinition: [
53+
zohoDesk,
54+
"ticketStatus",
55+
],
56+
},
57+
priority: {
58+
propDefinition: [
59+
zohoDesk,
60+
"ticketPriority",
61+
],
62+
},
63+
assigneeId: {
64+
propDefinition: [
65+
zohoDesk,
66+
"assigneeId",
67+
({ orgId }) => ({
68+
orgId,
69+
}),
70+
],
71+
},
72+
channel: {
73+
propDefinition: [
74+
zohoDesk,
75+
"channel",
76+
],
77+
},
78+
classification: {
79+
propDefinition: [
80+
zohoDesk,
81+
"classification",
82+
],
83+
},
84+
category: {
85+
propDefinition: [
86+
zohoDesk,
87+
"category",
88+
],
89+
},
90+
subCategory: {
91+
propDefinition: [
92+
zohoDesk,
93+
"subCategory",
94+
],
95+
},
96+
dueDate: {
97+
propDefinition: [
98+
zohoDesk,
99+
"dueDate",
100+
],
101+
},
102+
email: {
103+
type: "string",
104+
label: "Email",
105+
description: "Email address for the ticket",
106+
optional: true,
107+
},
108+
phone: {
109+
type: "string",
110+
label: "Phone",
111+
description: "Phone number for the ticket",
112+
optional: true,
113+
},
114+
productId: {
115+
propDefinition: [
116+
zohoDesk,
117+
"productId",
118+
],
119+
},
51120
},
52121
async run({ $ }) {
53122
const {
@@ -56,18 +125,44 @@ export default {
56125
contactId,
57126
subject,
58127
description,
128+
status,
129+
priority,
130+
assigneeId,
131+
channel,
132+
classification,
133+
category,
134+
subCategory,
135+
dueDate,
136+
email,
137+
phone,
138+
productId,
59139
} = this;
60140

141+
const data = {
142+
departmentId,
143+
contactId,
144+
subject,
145+
};
146+
147+
// Add optional fields
148+
if (description) data.description = description;
149+
if (status) data.status = status;
150+
if (priority) data.priority = priority;
151+
if (assigneeId) data.assigneeId = assigneeId;
152+
if (channel) data.channel = channel;
153+
if (classification) data.classification = classification;
154+
if (category) data.category = category;
155+
if (subCategory) data.subCategory = subCategory;
156+
if (dueDate) data.dueDate = dueDate;
157+
if (email) data.email = email;
158+
if (phone) data.phone = phone;
159+
if (productId) data.productId = productId;
160+
61161
const response = await this.zohoDesk.createTicket({
62162
headers: {
63163
orgId,
64164
},
65-
data: {
66-
departmentId,
67-
contactId,
68-
subject,
69-
description,
70-
},
165+
data,
71166
});
72167

73168
$.export("$summary", `Successfully created a new ticket with ID ${response.id}`);

components/zoho_desk/actions/find-contact/find-contact.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Find Contact",
66
description: "Searches for contacts in your help desk portal. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Search#Search_SearchContacts)",
77
type: "action",
8-
version: "0.0.6",
8+
version: "0.0.7",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/zoho_desk/actions/find-or-create-contact/find-or-create-contact.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Find or Create Contact",
66
description: "Finds or create a contact. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Contacts#Contacts_CreateContact)",
77
type: "action",
8-
version: "0.0.6",
8+
version: "0.0.7",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/zoho_desk/actions/get-article/get-article.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Get Article",
66
description: "Retrieves the details of a knowledge base article. [See the documentation](https://desk.zoho.com/portal/APIDocument.do#KnowledgeBase_Getarticle)",
77
type: "action",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

components/zoho_desk/actions/list-articles/list-articles.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
name: "List Articles",
55
description: "Lists knowledge base articles for a help center. [See the documentation](https://desk.zoho.com/portal/APIDocument.do#KnowledgeBase#KnowledgeBase_Listarticles)",
66
type: "action",
7-
version: "0.0.2",
7+
version: "0.0.3",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,

components/zoho_desk/actions/list-help-centers/list-help-centers.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "List Help Centers",
66
description: "Lists the help centers configured in an organization. [See the documentation](https://desk.zoho.com/portal/APIDocument.do#HelpCenters_Listhelpcenters)",
77
type: "action",
8-
version: "0.0.2",
8+
version: "0.0.3",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,

0 commit comments

Comments
 (0)