adding a comment to a Zendesk ticket is a very straightforward process, thanks to the standard zap provided by zendesk. The only problem with that method is that the author of the comment can’t be defined and will always show as the Account holder of the Zapier account, rather than the name of the actual author of the comment.
I tried pushing a comment via a custom webhook, but run into problems where my JSON can’t be parsed, when a comment contains line breaks or special characters such as “. I’m wondering how the underlying Zendesk code looks like, because they seem to be able to handle the JSON problem somehow. Is there anything I can do to get my comment into Zendesk the way I need it to?
Any help much appreciated.
I suspect you may have already got this solved but wanted to pop in to make a suggestion just in case you’re still having troubles with this.
I know the PUT, GET or POST event actions for the Webhooks by Zapier app will automatically try to parse the data for you which may be why it’s not handling the line breaks and special characters in correctly. I’m wondering if using the Custom Request event (Webhooks by Zapier) action might work better for you? That action doesn’t attempt to format or parse the JSON data so that might help.
If that doesn’t work, it may be worth adding a Code by Zapier or several Formatter (Text > Replace) actions to convert the newline characters into \n, double quotes to \" etc. in the message text to escape them. For the Code action I can’t provide the exact code you’d need but I found another topic in Community talks about using a code action to handle a very similar issue which you might find useful to review:
If you do give that a try and it works, or if you’ve already find a different solution, please let us know. Would love to know how you’re getting on. 🙂