We're trying to alert to MS teams via a Watcher Webhook, we've played with this a few ways without any luck.
Based on our research you really just need 3 values to post to teams.
In Headers
- "Content-Type": "application/json"
In the body
- "summary" : "Alert",
- "text" : "bad stuff happened "
The issue is, putting the values in they body. Most everything we've found says that the "Body" field is a string and you can't use json it . When we try some mash of {{#toJson}}ctx.payload.however_you_named_it{{/toJson}} it fails hard when we try to put summary and text in the payload.
Our example action (of maybe how it should work):
"actions": {
"MS_Teams": {
"webhook": {
"method": "POST",
"host": "outlook.office.com",
"port": 443,
"path": "/LONG_KEY_GOES HERE",
"headers": {
"Content-Type": "application/json"
},
"body": {
"summary": "Alert",
"text": "stuff that happened"
}
}
}
}
}