Skip to content

Commit 13c7230

Browse files
authored
Merging pull request #18705
* add include prop to get-ticket * list-ticket-conversations action
1 parent 8c20f2c commit 13c7230

File tree

3 files changed

+74
-3
lines changed

3 files changed

+74
-3
lines changed

components/freshdesk/actions/get-ticket/get-ticket.mjs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "freshdesk-get-ticket",
55
name: "Get Ticket Details",
66
description: "Get details of a Ticket. [See the documentation](https://developers.freshdesk.com/api/#view_a_ticket)",
7-
version: "0.1.6",
7+
version: "0.1.7",
88
annotations: {
99
destructiveHint: false,
1010
openWorldHint: true,
@@ -19,14 +19,31 @@ export default {
1919
"ticketId",
2020
],
2121
},
22+
include: {
23+
type: "string[]",
24+
label: "Include",
25+
description: "Include additional data in the response",
26+
optional: true,
27+
options: [
28+
"conversations",
29+
"requester",
30+
"company",
31+
"stats",
32+
],
33+
},
2234
},
2335
async run({ $ }) {
2436
const {
25-
freshdesk, ticketId,
37+
freshdesk, ticketId, include,
2638
} = this;
2739
const response = await freshdesk.getTicket({
2840
$,
2941
ticketId,
42+
params: include
43+
? {
44+
include: include.join(","),
45+
}
46+
: undefined,
3047
});
3148
response && $.export("$summary", "Successfully retrieved ticket");
3249
return response;
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import freshdesk from "../../freshdesk.app.mjs";
2+
3+
export default {
4+
key: "freshdesk-list-ticket-conversations",
5+
name: "List Conversations of a Ticket",
6+
description: "List all conversations for a ticket. [See the documentation](https://developers.freshdesk.com/api/#list_all_ticket_notes)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
freshdesk,
16+
ticketId: {
17+
propDefinition: [
18+
freshdesk,
19+
"ticketId",
20+
],
21+
},
22+
maxResults: {
23+
propDefinition: [
24+
freshdesk,
25+
"maxResults",
26+
],
27+
},
28+
},
29+
methods: {
30+
async listTicketConversations({
31+
ticketId, ...args
32+
}) {
33+
return this.freshdesk._makeRequest({
34+
url: `/tickets/${ticketId}/conversations`,
35+
...args,
36+
});
37+
},
38+
},
39+
async run({ $ }) {
40+
const results = await this.freshdesk.getPaginatedResources({
41+
fn: this.listTicketConversations,
42+
args: {
43+
$,
44+
ticketId: this.ticketId,
45+
},
46+
max: this.maxResults,
47+
});
48+
49+
$.export("$summary", `Successfully listed ${results.length} conversation${results.length === 1
50+
? ""
51+
: "s"}`);
52+
return results;
53+
},
54+
};

components/freshdesk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/freshdesk",
3-
"version": "0.5.0",
3+
"version": "0.6.0",
44
"description": "Pipedream Freshdesk Components",
55
"main": "freshdesk.app.mjs",
66
"keywords": [

0 commit comments

Comments
 (0)