Skip to content

Instantly share code, notes, and snippets.

@nbeernink
Last active October 5, 2016 11:04
Show Gist options
  • Save nbeernink/8d121e8230cdbdf79fc37986a2d04c8b to your computer and use it in GitHub Desktop.
Save nbeernink/8d121e8230cdbdf79fc37986a2d04c8b to your computer and use it in GitHub Desktop.
[cerb] relay notifications through slack with time and activity conditions
{
"behavior":{
"title":"Notifications to slack",
"is_disabled":false,
"is_private":false,
"event":{
"key":"event.notification.received.worker",
"label":"New notification for me"
},
"nodes":[
{
"type":"switch",
"title":"Between 09:00 and 23:00?",
"nodes":[
{
"type":"outcome",
"title":"Yes",
"params":{
"groups":[
{
"any":0,
"conditions":[
{
"condition":"_time_of_day",
"oper":"between",
"from":"09:00",
"to":"23:00"
},
{
"condition":"assignee_last_activity_date",
"oper":"!is",
"from":"-1 hour",
"to":"now"
}
]
}
]
},
"nodes":[
{
"type":"action",
"title":"Notify me on slack",
"params":{
"actions":[
{
"action":"core.va.action.http_request",
"http_verb":"post",
"http_url":"https:\/\/hooks.slack.com\/services\/yourtokenhere",
"http_headers":"",
"http_body":"payload={ \"channel\": \"@niek\", \"username\": \"cerb\", \"icon_emoji\": \":cerb:\", \"attachments\":[ { \"fallback\":\"{{message}} - {{url}}\",\"color\":\"#0099CC\", \"fields\":[ { \"title\":\"New notification in cerb\", \"value\":\"{{message}} - {{url}}\", \"short\":false } ] } ] }",
"run_in_simulator":"1",
"response_placeholder":"_http_response"
}
]
}
}
]
}
]
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment