Is it possible to customize JSON in an outgoing webhook alert contact in Grafana Cloud?

I am trying to add my Asana project as a contact point for alerting to basically automatically create tasks when an alert is triggered. Asana offers a webhook functionality so I figured it would be easy. When I tried it though I did not find a way to do that in Grafana Cloud. Asana has a particular way it needs the JSON to arrive to accept it and the only customizable part of the Grafana Cloud Webhook JSON seems to be the title and message which can be templated but not the JSON itself. Is there a way to create a JSON template?

I debugged the outgoing message and basically what I was going for was a very simple format required by asana which I tried to reproduce.
{ data: {“name”:“test”,“workspace”:“”,“assignee”:“”,“projects”:[“”]}}

But Instead, as a body template, this only gets in the message variable of the JSON and Grafana automatically adds: “receiver”:,“status”:,“alerts”:,“groupLabels”,“commonLabels”:,“commonAnnotations”:

Is there a way to determine the template of the whole JSON and not just the message and title variables?

1 Like