Skip to content

Commit fbd6561

Browse files
committed
Adding "ticketData" property to emitted comments
1 parent 56c6ec0 commit fbd6561

File tree

3 files changed

+96
-62
lines changed

3 files changed

+96
-62
lines changed

components/zendesk/package.json

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

components/zendesk/sources/new-ticket-comment-added/new-ticket-comment-added.mjs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
key: "zendesk-new-ticket-comment-added",
88
type: "source",
99
description: "Emit new event when a ticket comment has been added",
10-
version: "0.0.2",
10+
version: "0.1.0",
1111
dedupe: "unique",
1212
props: {
1313
app,
@@ -97,10 +97,16 @@ export default {
9797
},
9898
emitEvent(payload) {
9999
payload.ticketComments = this.convertCommentsToJson(payload.ticketComments);
100-
for (const comment of payload.ticketComments) {
100+
const {
101+
ticketComments, ...ticketData
102+
} = payload;
103+
for (const comment of ticketComments) {
101104
const ts = Date.parse(comment.created_at);
102105
const id = `${payload.ticketId}-${ts}`;
103-
this.$emit(comment, {
106+
this.$emit({
107+
...comment,
108+
ticketData,
109+
}, {
104110
id,
105111
summary: comment.value,
106112
ts,

0 commit comments

Comments
 (0)