启用Zendesk双向同步

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 个赞

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 个赞

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 个赞

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

您好!我设置好了一切,但它只从 Discourse 到 Zendesk 工作。我不知道我错过了什么,以便我的 Zendesk 回答可以发布到 Discourse 中。

我和 Marla 在这里^^^。我们已经让插件正常工作了!:tada:

但是我们想知道:如果话题被移到私信,是否有什么方法可以继续双向同步? 有时,我们的成员会请求重置密码,我们希望在社区内继续对话。

我已经尝试了上述过程,运行得很好! :partying_face: 但是,当 Zendesk 中的评论包含附件时,会出现一个问题——消息已收到,但附件丢失了。我不确定是否需要通过 webhook 传递其他参数来处理附件。有人能澄清一下是否需要任何特定参数吗?

谢谢!

我已经设置好了 Zendesk 插件,并且运行得很棒。我想启用双向同步评论,但我永远不想自动生成 Zendesk 工单。

看起来从 ZD 同步评论到 Discourse 需要启用自动生成。是这样吗?还是有其他方法?

我已经启用了 Zendesk 插件,并且将工单发布到 Zendesk 可以正常工作。但是,当我从 Zendesk Webhook 设置页面进行测试时,上面文档中的 Webhook (https:///zendesk-plugin/sync) 返回 404。因此,我无法从 Zendesk 更新论坛帖子。我哪里做错了?

另一个问题:如果我在 Zendesk 上关闭了工单,并且有人回复了 Discourse 帖子,那么已关闭的工单不会重新打开,我会错过新的帖子。有什么建议吗?

您好 Oliver,

我确信您已经意识到了,但同步 URL 需要包含您的域名。所以,与其仅仅是 https:///zendesk-plugin/sync,不如像这样:https://forum.yoursite.com/zendesk-plugin/sync

即使将工单设置为“已解决”,您仍然应该在 ZD 工单中看到任何 Discourse 回复。您只需要搜索该工单即可。:slight_smile:

例如,在我的测试站点上,我创建了一个帖子,并从中创建了一个 ZD 工单。我将工单标记为“已解决”,然后回复了 Discourse 上的主题。我在 ZD 工单上收到了评论: