Jun 15 2023 02:49 PM
I am trying to setup a slack integration to trigger the azure build pipeline using azure logic app.
I have completed the setup for slack command to point to logic app http request endpoint url. however i am unable to extract the parameter value passed with slack command as argument and set that as parameter to pass it to queue a build (azure devops)
Slack command:
/trigger-build ansible_verbosity=2 pa__name=max6 pa__tag=deploy pa_deployment_override=true version=5.8.3
Below are the HTTP request received output
{
"headers": {
"Accept": "application/json,*/*",
"Accept-Encoding": "gzip,deflate",
"Host": "prod-54.southeastasia.logic.azure.com",
"User-Agent": "Slackbot,1.0,(+https://api.slack.com/robots)",
"X-Slack-Signature": "v0=52408903d16175bc6a3e2eca1dd03a720b50adfb1bd3abac79fc49c9f6e8e256",
"X-Slack-Request-Timestamp": "1686864764",
"Content-Length": "554",
"Content-Type": "application/x-www-form-urlencoded"
},
"body": {
"$content-type": "application/x-www-form-urlencoded",
"$content": "dG9rZW49OEl3djZ0ZkJ6bmp4SXdwMEt0Rlk3dUt6JnRlYW1faWQ9VDA1QjFGWktURlYmdGVhbV9kb21haW49bGVhcm5henVyZWNsb3VkY29pbiZjaGFubmVsX2lkPUMwNUJSQjQzWTlXJmNoYW5uZWxfbmFtZT1hdXRvbWF0aW9uJnVzZXJfaWQ9VTA1QlJBWkxONTYmdXNlcl9uYW1lPXN5ZWQuYW1hbiZjb21tYW5kPSUyRnRyaWdnZXItYnVpbGQmdGV4dD1hbnNpYmxlX3ZlcmJvc2l0eSUzRDIrcGFfaW50ZXJuYWxfbmFtZSUzRG1heDYrcGFfZGVwbG95X3RhZyUzRGRlcGxveStwYV9kZXBsb3ltZW50X3BhdGNoX292ZXJyaWRlJTNEdHJ1ZSt2ZXJzaW9uJTNENS44LjMmYXBpX2FwcF9pZD1BMDVCMU41N0Y4QSZpc19lbnRlcnByaXNlX2luc3RhbGw9ZmFsc2UmcmVzcG9uc2VfdXJsPWh0dHBzJTNBJTJGJTJGaG9va3Muc2xhY2suY29tJTJGY29tbWFuZHMlMkZUMDVCMUZaS1RGViUyRjU0MzUyMDEzNzAwMTglMkZPaXhsYlEzUW1vUm96aENNc3MwZ2tTYjkmdHJpZ2dlcl9pZD01NDMyMjYyNDMyMTk3LjUzNzU1NDM2NzM1MzkuMDNlOWEwNWI5YjBhOWU5NWMwZTRjMTJhOGE3ZmM2ZmM=",
"$formdata": [
{
"key": "token",
"value": "8Iwv6tfBznjxIwp0KtFY7uKz"
},
{
"key": "team_id",
"value": "T05B1FZKTFV"
},
{
"key": "team_domain",
"value": "learnazurecloudcoin"
},
{
"key": "channel_id",
"value": "C05BRB43Y9W"
},
{
"key": "channel_name",
"value": "automation"
},
{
"key": "user_id",
"value": "U05BRAZLN56"
},
{
"key": "user_name",
"value": "syed.aman"
},
{
"key": "command",
"value": "/trigger-build"
},
{
"key": "text",
"value": "ansible_verbosity=2 pa_internal_name=max6 pa_deploy_tag=deploy pa_deployment_patch_override=true version=5.8.3"
},
{
"key": "api_app_id",
"value": "A05B1N57F8A"
},
{
"key": "is_enterprise_install",
"value": "false"
},
{
"key": "response_url",
"value": "https://hooks.slack.com/commands/T05B1FZKTFV/5435201370018/OixlbQ3QmoRozhCMss0gkSb9"
},
{
"key": "trigger_id",
"value": "5432262432197.5375543673539.03e9a05b9b0a9e95c0e4c12a8a7fc6fc"
}
]
}
}
The parameters which I had passed are stored as "text".
{
"key": "text",
"value": "ansible_verbosity=2 pa_internal_name=max6 pa_deploy_tag=deploy pa_deployment_patch_override=true version=5.8.3"
},
Need Help in extracting the values and setting it as a parameters to pass it to queue a build (azure devops)