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
21 changes: 19 additions & 2 deletions components/freshdesk/actions/get-ticket/get-ticket.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "freshdesk-get-ticket",
name: "Get Ticket Details",
description: "Get details of a Ticket. [See the documentation](https://developers.freshdesk.com/api/#view_a_ticket)",
version: "0.1.6",
version: "0.1.7",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand All @@ -19,14 +19,31 @@ export default {
"ticketId",
],
},
include: {
type: "string[]",
label: "Include",
description: "Include additional data in the response",
optional: true,
options: [
"conversations",
"requester",
"company",
"stats",
],
},
},
async run({ $ }) {
const {
freshdesk, ticketId,
freshdesk, ticketId, include,
} = this;
const response = await freshdesk.getTicket({
$,
ticketId,
params: include
? {
include: include.join(","),
}
: undefined,
});
response && $.export("$summary", "Successfully retrieved ticket");
return response;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import freshdesk from "../../freshdesk.app.mjs";

export default {
key: "freshdesk-list-ticket-conversations",
name: "List Conversations of a Ticket",
description: "List all conversations for a ticket. [See the documentation](https://developers.freshdesk.com/api/#list_all_ticket_notes)",
version: "0.0.1",
type: "action",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
props: {
freshdesk,
ticketId: {
propDefinition: [
freshdesk,
"ticketId",
],
},
maxResults: {
propDefinition: [
freshdesk,
"maxResults",
],
},
},
methods: {
async listTicketConversations({
ticketId, ...args
}) {
return this.freshdesk._makeRequest({
url: `/tickets/${ticketId}/conversations`,
...args,
});
},
},
async run({ $ }) {
const results = await this.freshdesk.getPaginatedResources({
fn: this.listTicketConversations,
args: {
$,
ticketId: this.ticketId,
},
max: this.maxResults,
});

$.export("$summary", `Successfully listed ${results.length} conversation${results.length === 1
? ""
: "s"}`);
return results;
},
};
2 changes: 1 addition & 1 deletion components/freshdesk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/freshdesk",
"version": "0.5.0",
"version": "0.6.0",
"description": "Pipedream Freshdesk Components",
"main": "freshdesk.app.mjs",
"keywords": [
Expand Down
Loading