From c94883dbb47d6f9c1c5cb74408453c87b99241f0 Mon Sep 17 00:00:00 2001 From: dicolanl Date: Tue, 7 Apr 2020 08:08:58 -0400 Subject: [PATCH] fix bug --- Playbooks/Post-Message-Slack/azuredeploy.json | 39 ++++++++----------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/Playbooks/Post-Message-Slack/azuredeploy.json b/Playbooks/Post-Message-Slack/azuredeploy.json index 4a2d24e208..f25c49a3c0 100644 --- a/Playbooks/Post-Message-Slack/azuredeploy.json +++ b/Playbooks/Post-Message-Slack/azuredeploy.json @@ -96,36 +96,29 @@ } }, "method": "get", - "path": "/cases/@{encodeURIComponent(triggerBody()?['SystemAlertId'])}/@{encodeURIComponent(triggerBody()?['WorkspaceSubscriptionId'])}/@{encodeURIComponent(triggerBody()?['WorkspaceId'])}/@{encodeURIComponent(triggerBody()?['WorkspaceResourceGroup'])}" + "path": "/Cases/@{encodeURIComponent(triggerBody()?['SystemAlertId'])}/@{encodeURIComponent(triggerBody()?['WorkspaceSubscriptionId'])}/@{encodeURIComponent(triggerBody()?['WorkspaceId'])}/@{encodeURIComponent(triggerBody()?['WorkspaceResourceGroup'])}" } }, - "For_each": { - "foreach": "@body('Alert_-_Get_incident')?['value']", - "actions": { - "Post_message": { - "runAfter": {}, - "type": "ApiConnection", - "inputs": { - "host": { - "connection": { - "name": "@parameters('$connections')['slack']['connectionId']" - } - }, - "method": "post", - "path": "/chat.postMessage", - "queries": { - "channel": "CN6BGHDJM", - "text": "New Alert:@{triggerBody()?['AlertDisplayName']}\nDescription: @{triggerBody()?['Description']}\nAlert Severity:@{triggerBody()?['Severity']}\nSubscription: @{triggerBody()?['WorkspaceSubscriptionId']}\n\nPlease Investigate.\n\n" - } - } - } - }, + "Post_message": { "runAfter": { "Alert_-_Get_incident": [ "Succeeded" ] }, - "type": "Foreach" + "type": "ApiConnection", + "inputs": { + "host": { + "connection": { + "name": "@parameters('$connections')['slack']['connectionId']" + } + }, + "method": "post", + "path": "/chat.postMessage", + "queries": { + "channel": "CN6BGHDJM", + "text": "New Alert:@{body('Alert_-_Get_incident')?['properties']?['Title']}\nDescription: @{body('Alert_-_Get_incident')?['properties']?['Description']}\nAlert Severity:@{body('Alert_-_Get_incident')?['properties']?['Severity']}\nSubscription: @{triggerBody()?['WorkspaceSubscriptionId']}\n\nPlease Investigate.\n\n" + } + } } }, "outputs": {}