"Send HTTP notification" sends invalid JSON

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.

Hi @Gpx,

Thanks for detailed description of the issue, I’ve passed your issue to the backend team - we’ll get back to you as soon as we know something!

1 Like

Hi @Gpx,

I’m happy to say we’ve just released the bugfix live. Can you confirm it’s working okay now?

Thank you @Kivlov, I will test in the following days and post the result here.