-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Description
Working with a customer, and though I don't know for sure this is their problem, feels like it probably is.
They are using a webhook action, with a JSON mustache template, that works in one case, but when they add an additional context variable to one of the property values in the JSON, they are getting a 500 response from the service they are calling.
My guess is the variable contains a " character. If so, it would end up rendering invalid JSON.
Eg,
template: {"foo": "{{context.bar}}"}
if context.bar evaluates to the string xyz, the result of rendering the template will be {"foo": "xyz"}, which is fine.
if context.bar evaluates to the string x"z, the result of rendering the template will be {"foo": "x"z"}, which is no longer valid JSON, and won't be usable in any webhook expecting JSON.
I don't know of any work-around for this ATM, nor am I sure how we can make fixes to make this work, given the way the mustache templating currently works with alert params.