Skip to content

Commit 45ee9b1

Browse files
committed
Fix after QA
1 parent 12a994c commit 45ee9b1

File tree

15 files changed

+150
-64
lines changed

15 files changed

+150
-64
lines changed

components/freshdesk/actions/assign-ticket-to-agent/assign-ticket-to-agent.mjs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import freshdesk from "../../freshdesk.app.mjs";
33
export default {
44
key: "freshdesk-assign-ticket-to-agent",
55
name: "Assign Ticket to Agent",
6-
description: "Assign a Freshdesk ticket to a specific agent",
7-
version: "0.0.3",
6+
description: "Assign a Freshdesk ticket to a specific agent. [See the documentation](https://developers.freshdesk.com/api/#update_ticket).",
7+
version: "0.0.13",
88
type: "action",
99
props: {
1010
freshdesk,
@@ -15,12 +15,16 @@ export default {
1515
],
1616
},
1717
responder_id: {
18-
type: "integer",
19-
label: "Agent ID",
20-
description: "ID of the agent to assign this ticket to",
18+
propDefinition: [
19+
freshdesk,
20+
"agentId",
21+
],
2122
},
2223
},
2324
async run({ $ }) {
25+
26+
const ticketName = await this.freshdesk.getTicketName(this.ticketId);
27+
2428
const response = await this.freshdesk._makeRequest({
2529
$,
2630
method: "PUT",
@@ -29,7 +33,9 @@ export default {
2933
responder_id: this.responder_id,
3034
},
3135
});
32-
$.export("$summary", `Ticket ${this.ticketId} assigned to agent ${this.responder_id}`);
36+
$.export("$summary",
37+
`Ticket "${ticketName}" (ID: ${this.ticketId}) assigned to agent ${this.responder_id}`);
38+
3339
return response;
3440
},
3541
};

components/freshdesk/actions/assign-ticket-to-group/assign-ticket-to-group.mjs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import freshdesk from "../../freshdesk.app.mjs";
33
export default {
44
key: "freshdesk-assign-ticket-to-group",
55
name: "Assign Ticket to Group",
6-
description: "Assign a Freshdesk ticket to a specific group",
7-
version: "0.0.3",
6+
description: "Assign a Freshdesk ticket to a specific group [See the documentation](https://developers.freshdesk.com/api/#update_ticket).",
7+
version: "0.0.7",
88
type: "action",
99
props: {
1010
freshdesk,
@@ -15,12 +15,16 @@ export default {
1515
],
1616
},
1717
group_id: {
18-
type: "integer",
19-
label: "Group ID",
20-
description: "ID of the group to assign this ticket to",
18+
propDefinition: [
19+
freshdesk,
20+
"groupId",
21+
],
2122
},
2223
},
2324
async run({ $ }) {
25+
26+
const ticketName = await this.freshdesk.getTicketName(this.ticketId);
27+
2428
const response = await this.freshdesk._makeRequest({
2529
$,
2630
method: "PUT",
@@ -29,7 +33,10 @@ export default {
2933
group_id: this.group_id,
3034
},
3135
});
32-
$.export("$summary", `Ticket ${this.ticketId} assigned to group ${this.group_id}`);
36+
37+
$.export("$summary",
38+
`Ticket "${ticketName}" (ID: ${this.ticketId}) assigned to group ${this.group_id}`);
39+
3340
return response;
3441
},
3542
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "freshdesk-close-ticket",
55
name: "Close Ticket",
66
description: "Set a Freshdesk ticket's status to 'Closed'. [See docs](https://developers.freshdesk.com/api/#update_a_ticket)",
7-
version: "0.0.3",
7+
version: "0.0.4",
88
type: "action",
99
props: {
1010
freshdesk,

components/freshdesk/actions/create-company/create-company.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "freshdesk-create-company",
55
name: "Create a Company",
66
description: "Create a company. [See the documentation](https://developers.freshdesk.com/api/#create_company)",
7-
version: "0.0.3",
7+
version: "0.0.4",
88
type: "action",
99
props: {
1010
freshdesk,

components/freshdesk/actions/create-contact/create-contact.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "freshdesk-create-contact",
66
name: "Create a Contact",
77
description: "Create a contact. [See the documentation](https://developers.freshdesk.com/api/#create_contact)",
8-
version: "0.0.3",
8+
version: "0.0.4",
99
type: "action",
1010
props: {
1111
freshdesk,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "freshdesk-create-ticket",
55
name: "Create a Ticket",
66
description: "Create a ticket. [See the documentation](https://developers.freshdesk.com/api/#create_ticket)",
7-
version: "0.0.4",
7+
version: "0.0.5",
88
type: "action",
99
props: {
1010
freshdesk,

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

Lines changed: 1 addition & 1 deletion
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.1",
7+
version: "0.1.2",
88
type: "action",
99
props: {
1010
freshdesk,

components/freshdesk/actions/list-all-tickets/list-all-tickets.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
name: "List Tickets",
66
description:
77
"Fetch up to 100 tickets according to the selected filters. [See the documentation](https://developers.freshdesk.com/api/#list_all_tickets)",
8-
version: "0.2.1",
8+
version: "0.2.2",
99
type: "action",
1010
props: {
1111
freshdesk,

components/freshdesk/actions/set-ticket-priority/set-ticket-priority.mjs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import freshdesk from "../../freshdesk.app.mjs";
33
export default {
44
key: "freshdesk-set-ticket-priority",
55
name: "Set Ticket Priority",
6-
description: "Update the priority of a ticket in Freshdesk",
7-
version: "0.0.3",
6+
description: "Update the priority of a ticket in Freshdesk [See the documentation](https://developers.freshdesk.com/api/#update_ticket).",
7+
version: "0.0.11",
88
type: "action",
99
props: {
1010
freshdesk,
@@ -22,6 +22,9 @@ export default {
2222
},
2323
},
2424
async run({ $ }) {
25+
26+
const ticketName = await this.freshdesk.getTicketName(this.ticketId);
27+
2528
const response = await this.freshdesk._makeRequest({
2629
$,
2730
method: "PUT",
@@ -30,7 +33,19 @@ export default {
3033
priority: this.ticketPriority,
3134
},
3235
});
33-
$.export("$summary", `Ticket ${this.ticketId} priority updated to ${this.ticketPriority}`);
36+
37+
const priorityLabels = {
38+
1: "Low",
39+
2: "Medium",
40+
3: "High",
41+
4: "Urgent",
42+
};
43+
44+
const priorityLabel = priorityLabels[this.ticketPriority] || this.ticketPriority;
45+
46+
$.export("$summary",
47+
`Ticket ${ticketName} (ID: ${this.ticketId}) priority updated to "${priorityLabel}".`);
48+
3449
return response;
3550
},
3651
};

components/freshdesk/actions/set-ticket-status/set-ticket-status.mjs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import freshdesk from "../../freshdesk.app.mjs";
33
export default {
44
key: "freshdesk-set-ticket-status",
55
name: "Set Ticket Status",
6-
description: "Update the status of a ticket in Freshdesk",
7-
version: "0.0.3",
6+
description: "Update the status of a ticket in Freshdesk [See the documentation](https://developers.freshdesk.com/api/#update_ticket).",
7+
version: "0.0.8",
88
type: "action",
99
props: {
1010
freshdesk,
@@ -22,6 +22,9 @@ export default {
2222
},
2323
},
2424
async run({ $ }) {
25+
26+
const ticketName = await this.freshdesk.getTicketName(this.ticketId);
27+
2528
const response = await this.freshdesk._makeRequest({
2629
$,
2730
method: "PUT",
@@ -30,7 +33,21 @@ export default {
3033
status: this.ticketStatus,
3134
},
3235
});
33-
$.export("$summary", `Ticket ${this.ticketId} status updated to ${this.ticketStatus}`);
36+
37+
const statusLabels = {
38+
2: "Open",
39+
3: "Pending",
40+
4: "Resolved",
41+
5: "Closed",
42+
};
43+
44+
const statusLabel = statusLabels[this.ticketStatus] || this.ticketStatus;
45+
46+
$.export(
47+
"$summary",
48+
`Ticket "${ticketName}" (ID: ${this.ticketId}) status updated to "${statusLabel}".`,
49+
);
50+
3451
return response;
3552
},
3653
};

0 commit comments

Comments
 (0)