Enabling Zendesk two-way synchronization

Summary

In this documentation, we will cover:

  • Enabling Zendesk synchronization settings in Discourse
  • Configuring a Zendesk webhook
  • Setting up a Zendesk trigger

Enabling Zendesk synchronization settings

To begin, you will need to enable a specific setting in Discourse and provide a secure token.

  1. Navigate to Admin Settings: Go to your Discourse site and navigate to the Admin settings page at /admin/site_settings.
  2. Enable Sync Setting: Find and enable the sync comments from zendesk setting.
  3. Provide Webhook Token: In the zendesk incoming webhook token, generate and add a random secure string. This token will be used later for configuring Zendesk’s webhook.

Setting up a Zendesk webhook

Follow these steps to configure a webhook in Zendesk:

  1. Access Webhooks Page: Navigate to the Webhooks section in Zendesk under Apps and integrationsWebhooks.
    • Example URL: https://<instance_name>.zendesk.com/admin/apps-integrations/webhooks/webhooks
  2. Create a Webhook:
    • Click the Actions button in the upper right corner.
    • Select Create Webhook.
    • Fill in the webhook details, ensuring you replace <discourse.example.com> with your Discourse site’s URL.


  1. Test the Webhook:
    • Click the Test Webhook button.
    • Select ‘Custom Test’ from the dropdown.
    • Replace the JSON with the following, inserting your token:
     {
         "ticket_id": "{{ticket.id}}",
         "topic_id": "{{ticket.external_id}}",
         "email": "{{current_user.email}}",
         "token": "INSERT TOKEN HERE"
     }
  • Hit Send Test. Expect a 400 Bad Request as a positive signal with the HTML page displayed indicating success.

Setting up a Zendesk trigger

Configure a trigger in Zendesk to automate actions:

  1. Access Triggers Page: Go to the Triggers section in Zendesk under AdminObjects and RulesBusiness RulesTriggers.
    • Example URL: https://<instance_name>.zendesk.com/admin/objects-rules/rules/triggers
  2. Create a Trigger:
    • Click Add trigger.
    • Name it “Discourse Sync” and set the category to “Notifications”.
    • Configure the conditions and actions as depicted below.



  • Use the same JSON body as in the test webhook step, again replacing “INSERT TOKEN HERE” with your token.
  1. Save the Trigger: Once configured, make sure to save the trigger.

Last edited by @jessii 2024-10-29T18:59:23Z

Check documentPerform check on document:
10 Likes

Hey @techAPJ this is really awesome! Is there a way to set up a triggered sync as opposed to a live sync? i.e. an agent would add a tag in ZD or hit a button or something and only then would the ticket sync to the community?
We are trying to figure out the best way to share common FAQ tickets we get to ZD in the community with the Q&A so that users can find the answers there instead of writing in a ticket.
Thanks!

3 Likes

The only triggered sync we have currently is from Discourse → Zendesk.

Triggering a manual sync from Zendesk → Discourse is tricky since we do not have complete control on Zendesk. That said, I’ll investigate if there is a way to trigger webhook from Zendesk by adding a tag, etc.

3 Likes

@techAPJ did you ever look into ZD to Discourse sync? We are looking at ways to push FAQs from tickets on Zendesk to Discourse!

Hello! I set everything up but it only works from Discourse to Zendesk. I don’t know what I’m missing so that my answers in Zendesk can be published in Discourse

Hi I’m with Marla here ^^^. We got the plugin to work! :tada:

But we’re wondering: is there’s any way to continue the two way sync when/if the topic is moved to a private message? Sometimes, our members will ask for password re-sets and we’d like to continue the conversation within the community.

I have tried the above process, and it’s working fine! :partying_face: However, there’s an issue when a comment in Zendesk contains an attachment—the message is coming through, but the attachment is missing. I’m not sure if there’s an additional parameter that needs to be passed in the webhook to handle attachments. Could someone please clarify if there are any specific parameters required for this?

Thank you!

I’ve just set up the Zendesk plugin and it’s working great. I’d like to enable two-way sync for comments, but I do not want to autogenerate a Zendesk ticket… ever, really.

It looks like syncing comments from ZD->Discourse requires enabling autogeneration. Is that the case, or is there a workaround?

I’ve enable the Zendesk plugin and posting tickets to Zendesk works. But the Webhook in the documentation above (https:///zendesk-plugin/sync) returns a 404 when I test it from the Zendesk Webhook setup page. Subsequently, I can’t update forum posts from Zendesk. What am I doing wrong?

Another issue: If I close the ticket on Zendesk and someone replies to the Discourse post, the closed ticket isn’t re-opened and I miss the new post. Any hints?