I have a “Send HTTP notification” action in my pipeline. I noticed that in some occasions it sends malformed data. My server says it has an invalid JSON format. I debugged it a bit and found out that the problem appears if my commit message has quotes in it.
I think this i what’s happening. In my payload configuration I have the following code
"message": "${execution.from_revision.message}"
Now, if my message
is This is a "commit"
it all gets compiled down to
"message": "This is a "commit""
Which is of course invalid JSON. My variables should be escaped when used in JSON
"message": "This is a \"commit\"
I’m not sure if there’s an escape
function or similar that I’ve missed from the documentation.
Thanks for the help.