Send notifications to my phone from issue reporter

This commit is contained in:
2025-03-22 23:16:59 -04:00
parent b6bd149610
commit bb6dd3cf3e
2 changed files with 22 additions and 1 deletions

View File

@ -0,0 +1,20 @@
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`})

View File

@ -4,6 +4,7 @@ const typeEnhancementLabel = flow.get("typeEnhancementLabel", "diskCon")
const typeAdjustmentLabel = flow.get("typeAdjustmentLabel", "diskCon") const typeAdjustmentLabel = flow.get("typeAdjustmentLabel", "diskCon")
const title = msg.text const title = msg.text
const type = msg.type const type = msg.type
const user = msg.user
let labels = [needsReponseLabel] let labels = [needsReponseLabel]
let formatType = {} let formatType = {}
@ -23,7 +24,7 @@ let newTitle = `${formatType}: ${title}`
msg.payload = { msg.payload = {
"title": newTitle, "title": newTitle,
"body": "This issue was submitted by the automated form on the main Home Assistant dashboard", "body": `This issue was submitted by ${user.firstName} ${user.lastName}, using the automated form on the main Home Assistant dashboard`,
"assignees":["tm24fan8"], "assignees":["tm24fan8"],
"labels": labels "labels": labels
} }