20 lines
570 B
JavaScript
20 lines
570 B
JavaScript
const statusCode = msg.statusCode
|
|
const issueNumber = msg.payload.number
|
|
const issueTitle = msg.payload.title
|
|
const url = msg.payload.html_url
|
|
const user = msg.user
|
|
|
|
let notification = {
|
|
"title": "Issue Submitted",
|
|
"message": `${user.firstName} ${user.lastName} submitted a new issue: #${issueNumber} - ${issueTitle}`,
|
|
"actions": [
|
|
{
|
|
"action": "URI",
|
|
"uri": url,
|
|
"title": "View Issue"
|
|
}
|
|
]
|
|
}
|
|
|
|
node.send(notification)
|
|
node.status({fill:'green',shape:'dot',text:`Issue #${issueNumber} notification sent`}) |