Want to enable Zendesk two-way sync? Here is how to do that.
Enable “sync comments from zendesk” setting
Navigate to your Discourse Admin settings page (/admin/site_settings
) and enable sync comments from zendesk
setting.
Provide a random secure string in zendesk incoming webhook token
setting. This will be used later for configuring Zendesk webhook.
Setting Up Outgoing HTTP Zendesk Integration
Navigate to the Extensions page via Admin/Settings/Extensions. The URL should look something like this: https://<company_name>.zendesk.com/agent/admin/extensions/
Click on the add target button
Select ‘HTTP Target’ option
Add Discourse as the title on the HTTP target form. The URL on the form should be https://<discourse.example.com>/zendesk-plugin/sync
(replace <discourse.example.com>
with your forum URL). Select PUT as the method and JSON for the content type. Next, select Create target in the menu next to the Submit button. Finally, click Submit to create the target.
The HTTP target is now ready to use. Now we need to create a trigger and send data to the target.
Setting Up a Zendesk Trigger
Go to the Triggers page in Zendesk, which should be under Admin/Business Rules/Triggers . The URL should look like this: https://<company_name>.zendesk.com/agent/admin/triggers
.
Click on Add trigger
Add “Discourse Sync” as trigger name & description. Then add conditions for the trigger as shown below:
Add Actions for the trigger. Select action as Notify Target and target as Discourse.
In the JSON body paste the following block:
{
"ticket_id": "{{ticket.id}}",
"topic_id": "{{ticket.external_id}}",
"email": "{{current_user.email}}",
"token": "INSERT TOKEN HERE"
}
Replace “INSERT TOKEN HERE” with the secret token you provided in zendesk incoming webhook token
setting.
Click the Create button to get the trigger ready.
Voilà
That’s it! Now when a new topic is created in Zendesk enabled category and a reply is made on Zendesk for that ticket the comment will be auto-posted on relevant Discourse topic as well.