Closed KrunchMuffin closed 8 years ago
Here is a Slack rule that you can use as a guide: https://github.com/oarevalo/BugLogHQ-utils/tree/master/extensions/rules
I have most of that, although I am using attachments. Is there no way to get the serverkey? I want to show the environment.
var payload = {
"username": "BugLog",
"icon_emoji": ":buglog:",
"attachments": [
{
"fallback": "#q.severityCode# - #q.message#: #getBugEntryHREF(q.EntryID)#",
"title": "#intro#",
"text": "<#getBugEntryHREF(q.EntryID)#|#q.severityCode# - #q.message#>",
"fields": [
{
"title": "Application",
"value": "#q.ApplicationCode#",
"short": true
},
{
"title": "Environment",
"value": "#ListLast(q.ApplicationCode,'_')#",
"short": true
},
{
"title": "Template",
"value": "#q.templatePath#",
"short": false
}
],
"color": "danger"
}
]
};
from within your rule try this, I think this will return what you want:
getListener().getConfig().getConfigKey()
alternatively, if you are using instances, you can also use:
getListener().getInstanceName()
sweet! works great! Thanks!
:+1:
I am trying to create a new rule to post to Slack webhook. How can i get the severity and the serverkey?