Zendesk webhook doesn't notify whether comment is public or private | Community
Skip to main content

Zendesk webhook doesn't notify whether comment is public or private

  • July 2, 2024
  • 5 replies
  • 0 views

Matt38

We have webhooks set up to notify when a ticket is updated in Zendesk, but it looks like when a comment is added to a ticket, the webhook doesn't let us know whether the comment is private or public. In the screenshot you can see that the ticket was updated with a comment (and it is an internal comment), but the webhook comment_publicity field is blank. I've also tested this with public comments and that field is still blank.

5 replies

Tipene
  • July 23, 2024

Hey Matt,

Would you mind sharing a screenshot or code snippet of how you've got the JSON body formatted in the trigger action that notifies your webhook?

Thanks!

Tipene


Matt38
  • Author
  • July 29, 2024

Hi Tipene - here is an example body that we use to make to POST triggers:

 

{"trigger": {"title": "Webhook trigger created by integration to capture real-time ticket creation, updates, comments and attachments", "actions": [{"field": "notification_webhook", "value": ["01J3RJFM9CT41QD1M10Z5HNEN7", "{\n\t\"event\": \"ticket\",\n\t\"ticket\": {\n \"id\": \"{{ticket.id}}\",\n \"title\": \"{{ticket.title}}\",\n \"description\": \"{{ticket.description}}\",\n \"due_at\": \"{{ticket.due_date}}\",\n \"status\": \"{{ticket.status}}\",\n \"tags\": \"{{ticket.tags}}\",\n \"ticket_type\": \"{{ticket.ticket_type}}\",\n \"assignee_id\": \"{{ticket.assignee.id}}\",\n \"organization_id\": \"{{ticket.organization.id}}\",\n \"requester_id\": \"{{ticket.requester.id}}\",\n \"requester\": \"{{ticket.requester.details}}\",\n\t \"requester_role\": \"{{ticket.requester.role}}\",\n\t \"account\": \"{{ticket.account.id}}\",\n \"priority\": \"{{ticket.priority}}\",\n \"via\": \"{{ticket.via}}\",\n \"url\": \"{{ticket.url}}\",\n\t \"comment_id\": \"{{ticket.latest_comment.id}}\",\n\t \"comment_body\": \"{{ticket.latest_comment}}\",\n\t \"comment_publicity\": \"{{ticket.latest_comment.public}}\",\n\t \"comment_created_at\": \"{{ticket.latest_comment.created_at}}\",\n\t \"comment_html_body\": \"{{ticket.latest_comment_html}}\",\n\t \"comment_author\": \"{{ticket.latest_comment.author.id}}\",\n\t \"comment_author_role\": \"{{ticket.latest_comment.author.role}}\",\n\t \"attachments\": \"{{ticket.latest_comment.attachments}}\"\n }\n}\n"]}], "conditions": {"any": [{"field": "update_type", "value": "Change", "operator": "is"}, {"field": "update_type", "value": "Create", "operator": "is"}]}}}


Tipene
  • August 1, 2024
Thanks for sharing, Matt!
 
Can you try updating the {{ticket.latest_comment.public}} placeholder to {{ticket.latest_comment.is_public}}.

Matt38
  • Author
  • August 2, 2024

Thanks Tipene! I'll flag this to my team and let you know


Matt38
  • Author
  • August 7, 2024

That resolved the issue thank you!