Skip to content

Commit 1a1245b

Browse files
sicarius97claude
andcommitted
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 <[email protected]>
1 parent c52e201 commit 1a1245b

File tree

6 files changed

+365
-48
lines changed

6 files changed

+365
-48
lines changed

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/send-email-reply/send-email-reply.mjs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Send E-Mail Reply",
66
description: "Sends an email reply. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Threads#Threads_SendEmailReply)",
77
type: "action",
8-
version: "0.0.6",
8+
version: "0.0.7",
99
annotations: {
1010
destructiveHint: false,
1111
openWorldHint: true,
@@ -73,16 +73,12 @@ export default {
7373
description: "Content of the thread",
7474
optional: true,
7575
},
76-
ticketStatus: {
77-
type: "string",
78-
label: "Ticket Status",
79-
description: "Type of ticket resolution status. The values supported are `OPEN` and `ON HOLD` and `CLOSED`.",
80-
optional: true,
81-
options: [
82-
"OPEN",
83-
"ON HOLD",
84-
"CLOSED",
76+
status: {
77+
propDefinition: [
78+
zohoDesk,
79+
"ticketStatus",
8580
],
81+
description: "Type of ticket resolution status to set after sending the email reply.",
8682
},
8783
},
8884
async run({ $ }) {
@@ -93,23 +89,27 @@ export default {
9389
to,
9490
content,
9591
contentType,
96-
ticketStatus,
92+
status,
9793
} = this;
9894

95+
const data = {
96+
fromEmailAddress,
97+
to,
98+
channel: "EMAIL",
99+
isForward: "true",
100+
};
101+
102+
// Add optional fields
103+
if (content) data.content = content;
104+
if (contentType) data.contentType = contentType;
105+
if (status) data.ticketStatus = status;
106+
99107
const response = await this.zohoDesk.sendReply({
100108
ticketId,
101109
headers: {
102110
orgId,
103111
},
104-
data: {
105-
fromEmailAddress,
106-
to,
107-
content,
108-
contentType,
109-
ticketStatus,
110-
channel: "EMAIL",
111-
isForward: "true",
112-
},
112+
data,
113113
});
114114

115115
$.export("$summary", `Successfully sent email reply with ID ${response.id}`);

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

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "Update Contact",
66
description: "Updates details of an existing contact. [See the docs here](https://desk.zoho.com/DeskAPIDocument#Contacts#Contacts_Updateacontact)",
77
type: "action",
8-
version: "0.0.6",
8+
version: "0.0.7",
99
annotations: {
1010
destructiveHint: true,
1111
openWorldHint: true,
@@ -32,6 +32,7 @@ export default {
3232
type: "string",
3333
label: "Last Name",
3434
description: "Last name of the contact",
35+
optional: true,
3536
},
3637
firstName: {
3738
type: "string",
@@ -57,6 +58,27 @@ export default {
5758
description: "Mobile number of the contact",
5859
optional: true,
5960
},
61+
accountId: {
62+
propDefinition: [
63+
zohoDesk,
64+
"accountId",
65+
({ orgId }) => ({
66+
orgId,
67+
}),
68+
],
69+
},
70+
title: {
71+
type: "string",
72+
label: "Title",
73+
description: "Job title of the contact",
74+
optional: true,
75+
},
76+
description: {
77+
type: "string",
78+
label: "Description",
79+
description: "Description about the contact",
80+
optional: true,
81+
},
6082
},
6183
async run({ $ }) {
6284
const {
@@ -67,20 +89,29 @@ export default {
6789
email,
6890
phone,
6991
mobile,
92+
accountId,
93+
title,
94+
description,
7095
} = this;
7196

97+
const data = {};
98+
99+
// Add optional fields
100+
if (lastName) data.lastName = lastName;
101+
if (firstName) data.firstName = firstName;
102+
if (email) data.email = email;
103+
if (phone) data.phone = phone;
104+
if (mobile) data.mobile = mobile;
105+
if (accountId) data.accountId = accountId;
106+
if (title) data.title = title;
107+
if (description) data.description = description;
108+
72109
const response = await this.zohoDesk.updateContact({
73110
contactId,
74111
headers: {
75112
orgId,
76113
},
77-
data: {
78-
lastName,
79-
firstName,
80-
email,
81-
phone,
82-
mobile,
83-
},
114+
data,
84115
});
85116

86117
$.export("$summary", `Successfully updated contact with ID ${response.id}`);

0 commit comments

Comments
 (0)