Skip to content
Merged
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 @@ -5,7 +5,7 @@ export default {
name: "Add Ticket Tags",
description: "Add tags to a ticket (appends to existing tags). [See the documentation](https://developer.zendesk.com/api-reference/ticketing/ticket-management/tags/#add-tags).",
type: "action",
version: "0.0.3",
version: "0.0.4",
props: {
app,
ticketId: {
Expand Down
2 changes: 1 addition & 1 deletion components/zendesk/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. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#create-ticket).",
type: "action",
version: "0.1.7",
version: "0.1.8",
props: {
app,
ticketCommentBody: {
Expand Down
2 changes: 1 addition & 1 deletion components/zendesk/actions/delete-ticket/delete-ticket.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Delete Ticket",
description: "Deletes a ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#delete-ticket).",
type: "action",
version: "0.1.7",
version: "0.1.8",
props: {
app,
ticketId: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Get Ticket Info",
description: "Retrieves information about a specific ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#show-ticket).",
type: "action",
version: "0.0.5",
version: "0.0.6",
props: {
app,
ticketId: {
Expand Down
2 changes: 1 addition & 1 deletion components/zendesk/actions/get-user-info/get-user-info.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "zendesk-get-user-info",
name: "Get User Info",
description: "Retrieves information about a specific user. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/users/users/#show-user).",
version: "0.0.2",
version: "0.0.3",
type: "action",
props: {
zendesk,
Expand Down
2 changes: 1 addition & 1 deletion components/zendesk/actions/list-locales/list-locales.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "zendesk-list-locales",
name: "List Locales",
description: "Retrieves all locales. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/account-configuration/locales/).",
version: "0.0.2",
version: "0.0.3",
type: "action",
props: {
zendesk,
Expand Down
2 changes: 1 addition & 1 deletion components/zendesk/actions/list-macros/list-macros.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "zendesk-list-macros",
name: "List Macros",
description: "Retrieves all macros. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/business-rules/macros/#list-macros).",
version: "0.0.2",
version: "0.0.3",
type: "action",
props: {
zendesk,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "zendesk-list-ticket-comments",
name: "List Ticket Comments",
description: "Retrieves all comments for a specific ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_comments/#list-comments).",
version: "0.0.2",
version: "0.0.3",
type: "action",
props: {
zendesk,
Expand Down
2 changes: 1 addition & 1 deletion components/zendesk/actions/list-tickets/list-tickets.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "List Tickets",
description: "Retrieves a list of tickets. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#list-tickets).",
type: "action",
version: "0.0.5",
version: "0.0.6",
props: {
app,
sortBy: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Remove Ticket Tags",
description: "Remove specific tags from a ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/ticket-management/tags/#remove-tags).",
type: "action",
version: "0.0.3",
version: "0.0.4",
props: {
app,
ticketId: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Search Tickets",
description: "Searches for tickets using Zendesk's search API. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/ticket-management/search/#search-tickets).",
type: "action",
version: "0.0.6",
version: "0.0.7",
props: {
app,
query: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Set Ticket Tags",
description: "Set tags on a ticket (replaces all existing tags). [See the documentation](https://developer.zendesk.com/api-reference/ticketing/ticket-management/tags/#set-tags).",
type: "action",
version: "0.0.3",
version: "0.0.4",
props: {
app,
ticketId: {
Expand Down
57 changes: 47 additions & 10 deletions components/zendesk/actions/update-ticket/update-ticket.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
name: "Update Ticket",
description: "Updates a ticket. [See the documentation](https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/#update-ticket).",
type: "action",
version: "0.2.0",
version: "0.2.1",
props: {
app,
ticketId: {
Expand Down Expand Up @@ -89,6 +89,18 @@ export default {
optional: true,
default: "set",
},
assigneeId: {
propDefinition: [
app,
"assigneeId",
],
},
assigneeEmail: {
propDefinition: [
app,
"assigneeEmail",
],
},
},
methods: {
updateTicket({
Expand All @@ -113,6 +125,8 @@ export default {
attachments,
ticketTags,
tagAction,
assigneeId,
assigneeEmail,
} = this;

const ticketComment = ticketCommentBodyIsHTML
Expand Down Expand Up @@ -143,24 +157,47 @@ export default {
}
}

// Build ticket data object
const ticketData = {
comment: ticketComment,
priority: ticketPriority,
subject: ticketSubject,
status: ticketStatus,
};

// Add assignee fields if provided
if (assigneeId) {
ticketData.assignee_id = assigneeId;
}
if (assigneeEmail) {
ticketData.assignee_email = assigneeEmail;
}

const response = await this.updateTicket({
step,
ticketId,
customSubdomain,
data: {
ticket: {
comment: ticketComment,
priority: ticketPriority,
subject: ticketSubject,
status: ticketStatus,
},
ticket: ticketData,
},
});

const attachmentCount = ticketComment.uploads?.length || 0;
const summary = attachmentCount > 0
? `Successfully updated ticket with ID ${response.ticket.id} with ${attachmentCount} attachment(s)`
: `Successfully updated ticket with ID ${response.ticket.id}`;
const assigneeUpdated = assigneeId || assigneeEmail;

let summary = `Successfully updated ticket with ID ${response.ticket.id}`;

const updates = [];
if (attachmentCount > 0) {
updates.push(`${attachmentCount} attachment(s)`);
}
if (assigneeUpdated) {
updates.push("assignee");
}

if (updates.length > 0) {
summary += ` with ${updates.join(" and ")}`;
}

step.export("$summary", summary);

Expand Down
2 changes: 1 addition & 1 deletion components/zendesk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/zendesk",
"version": "0.8.2",
"version": "0.8.3",
"description": "Pipedream Zendesk Components",
"main": "zendesk.app.mjs",
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
export default {
...common,
key: "zendesk-locale-updated",
name: "Locale Updated",

Check warning on line 6 in components/zendesk/sources/locale-updated/locale-updated.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
type: "source",
description: "Emit new event when a locale has been updated",
version: "0.0.2",
version: "0.0.3",
dedupe: "unique",
async run() {
const lastTs = this._getLastTs();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "zendesk-new-ticket-comment-added",
type: "source",
description: "Emit new event when a ticket comment has been added",
version: "0.0.2",
version: "0.0.3",
dedupe: "unique",
props: {
app,
Expand Down
2 changes: 1 addition & 1 deletion components/zendesk/sources/new-ticket/new-ticket.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default {
key: "zendesk-new-ticket",
type: "source",
description: "Emit new event when a ticket is created",
version: "0.2.7",
version: "0.2.8",
dedupe: "unique",
methods: {
...common.methods,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "zendesk-ticket-added-to-view",
name: "New Ticket Added to View (Instant)",
description: "Emit new event when a ticket is added to the specified view",
version: "0.0.7",
version: "0.0.8",
type: "source",
dedupe: "unique",
props: {
Expand Down
2 changes: 1 addition & 1 deletion components/zendesk/sources/ticket-closed/ticket-closed.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

export default {
...common,
name: "Ticket Closed (Instant)",

Check warning on line 5 in components/zendesk/sources/ticket-closed/ticket-closed.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
key: "zendesk-ticket-closed",
type: "source",
description: "Emit new event when a ticket has changed to closed status",
version: "0.2.7",
version: "0.2.8",
dedupe: "unique",
methods: {
...common.methods,
Expand Down
2 changes: 1 addition & 1 deletion components/zendesk/sources/ticket-pended/ticket-pended.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

export default {
...common,
name: "Ticket Pending (Instant)",

Check warning on line 5 in components/zendesk/sources/ticket-pended/ticket-pended.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
key: "zendesk-ticket-pended",
type: "source",
description: "Emit new event when a ticket has changed to pending status",
version: "0.2.7",
version: "0.2.8",
dedupe: "unique",
methods: {
...common.methods,
Expand Down
2 changes: 1 addition & 1 deletion components/zendesk/sources/ticket-solved/ticket-solved.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

export default {
...common,
name: "Ticket Solved (Instant)",

Check warning on line 5 in components/zendesk/sources/ticket-solved/ticket-solved.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
key: "zendesk-ticket-solved",
type: "source",
description: "Emit new event when a ticket has changed to solved status",
version: "0.2.7",
version: "0.2.8",
dedupe: "unique",
methods: {
...common.methods,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

export default {
...common,
name: "Ticket Updated (Instant)",

Check warning on line 5 in components/zendesk/sources/ticket-updated/ticket-updated.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Source names should start with "New". See https://pipedream.com/docs/components/guidelines/#source-name
key: "zendesk-ticket-updated",
type: "source",
description: "Emit new event when a ticket has been updated",
version: "0.2.7",
version: "0.2.8",
dedupe: "unique",
methods: {
...common.methods,
Expand Down
38 changes: 38 additions & 0 deletions components/zendesk/zendesk.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,44 @@ export default {
description: "Array of tags to apply to the ticket. These will replace any existing tags on the ticket.",
optional: true,
},
assigneeId: {
type: "string",
label: "Assignee ID",
description: "The ID of the agent to assign the ticket to",
optional: true,
async options({ prevContext }) {
const { afterCursor } = prevContext;

const {
users,
meta,
} = await this.listUsers({
params: {
[constants.PAGE_SIZE_PARAM]: constants.DEFAULT_LIMIT,
[constants.PAGE_AFTER_PARAM]: afterCursor,
role: "agent",
},
});

return {
context: {
afterCursor: meta.after_cursor,
},
options: users.map(({
id, name,
}) => ({
label: name,
value: id,
})),
};
},
},
assigneeEmail: {
type: "string",
label: "Assignee Email",
description: "The email address of the agent to assign the ticket to",
optional: true,
},
},
methods: {
getUrl(path, customSubdomain) {
Expand Down
Loading