Message to Slack when Request created
Rule config:
[
{
"type": "source:targetprocess:EntityChanged",
"entityTypes": [
"Request"
],
"modifications": {
"created": true,
"deleted": false,
"updated": false
}
},
{
"url": {
"type": "constant",
"value": "https://hooks.slack.com/services/some/slack/endpoing"
},
"body": {
"type": "concat",
"operands": [
{
"type": "constant",
"value": "{\n \"text\": \"New request was created in project "
},
{
"args": [
{
"name": "Name",
"type": "field",
"target": {
"name": "Project",
"type": "field",
"target": {
"type": "pipelineBlockOutput"
}
}
}
],
"name": "ToJsonText",
"type": "call"
},
{
"type": "constant",
"value": "!\",\n \"attachments\": [\n {\n \t\"callback_id\": \""
},
{
"name": "Name",
"type": "field",
"target": {
"name": "EntityType",
"type": "field",
"target": {
"type": "pipelineBlockOutput"
}
}
},
{
"type": "constant",
"value": "/"
},
{
"name": "Id",
"type": "field",
"target": {
"type": "pipelineBlockOutput"
}
},
{
"type": "constant",
"value": "\",\n \"fallback\": \"Non-interactive\",\n \"attachment_type\": \"default\",\n \"text\": \""
},
{
"args": [
{
"name": "Name",
"type": "field",
"target": {
"type": "pipelineBlockOutput"
}
}
],
"name": "ToJsonText",
"type": "call"
},
{
"type": "constant",
"value": "\",\n \"actions\": [\n {\n \"name\": \"go\",\n \"text\": \":mag: See details\",\n \"type\": \"button\",\n \"url\": \""
},
{
"name": "EntityUri",
"type": "field",
"target": {
"type": "pipelineBlockOutput"
}
},
{
"type": "constant",
"value": "\"\n }\n ]\n }\n ]\n}\n"
}
]
},
"type": "action:SendHttpRequest"
}
]
Updated over 5 years ago