32
issue-reports/prep-api-data.js
Normal file
32
issue-reports/prep-api-data.js
Normal file
@ -0,0 +1,32 @@
|
||||
const needsReponseLabel = flow.get("needsReponseLabel", "diskCon")
|
||||
const typeBugLabel = flow.get("typeBugLabel", "diskCon")
|
||||
const typeEnhancementLabel = flow.get("typeEnhancementLabel", "diskCon")
|
||||
const typeAdjustmentLabel = flow.get("typeAdjustmentLabel", "diskCon")
|
||||
const title = msg.text
|
||||
const type = msg.type
|
||||
|
||||
let labels = [needsReponseLabel]
|
||||
let formatType = {}
|
||||
|
||||
if (type === 'Bug Report') {
|
||||
labels.push(typeBugLabel)
|
||||
formatType = "[Bug]"
|
||||
} else if (type === 'New Idea') {
|
||||
labels.push(typeEnhancementLabel)
|
||||
formatType = "[Feature Request]"
|
||||
} else if (type === 'Adjustment') {
|
||||
labels.push(typeAdjustmentLabel)
|
||||
formatType = "[Adjustment Request]"
|
||||
}
|
||||
|
||||
let newTitle = `${formatType}: ${title}`
|
||||
|
||||
msg.payload = {
|
||||
"title": newTitle,
|
||||
"body": "This issue was submitted by the automated form on the main Home Assistant dashboard",
|
||||
"assignees":["tm24fan8"],
|
||||
"labels": labels
|
||||
}
|
||||
|
||||
node.status({fill:'green',shape:'dot',text:'API data prepped'})
|
||||
return msg
|
Reference in New Issue
Block a user