Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
47 changes: 39 additions & 8 deletions components/zoho_desk/actions/create-contact/create-contact.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand All @@ -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}`);
Expand Down
109 changes: 102 additions & 7 deletions components/zoho_desk/actions/create-ticket/create-ticket.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand All @@ -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}`);
Expand Down
2 changes: 1 addition & 1 deletion components/zoho_desk/actions/find-contact/find-contact.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion components/zoho_desk/actions/get-article/get-article.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading
Loading