Forum Discussion
Custom JSON Webhook for Teams showing search results
I've come here seeking an answer to the same question and am hoping to bump this for the OP, myself, and others.
We are also attempting to use the MessageCard in Teams as we use it for a LOT of things and it works great. However, for Alerts with a limited result set I want the results included. We've included the
"IncludeSearchResults":true,
and done so as a top-level property in the custom JSON payload. While we get our expected card in the target Teams channel when the Alert Rule fires we do not get the expected results.
While you can include #variables using the "hashtag" format -- for which we assume they pre-processing the payload and performing text-replacement on your JSON before it is sent, and which makes perfect sense.
What is a whole lot less clear is why we are asked to include a specific key-value pair in a payload intended for the ultimate recipient of the JSON. Why are we not simply asked to use #searchResults so their pre-processing of the payload can insert the table?
On the above basis I think either the documentation is incorrect on this one or woefully unclear -- but I'm all ears to anyone who might be able to demystify what's meant to be going on here.
Avid_Azure_User To get the context of the alert in the payload we recommend using dimensions, not relaying on the search results. This will provide you with the pairs you need.
Overall include search results is best effort and is not means to get context of the alerts. To get the full results provide the links in the payload.