تفعيل المزامنة ثنائية الاتجاه لـ 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

مرحباً، أنا مع مارلا هنا ^^^. لقد نجحنا في تشغيل المكون الإضافي! :tada:

لكننا نتساءل: هل هناك أي طريقة لمواصلة المزامنة ثنائية الاتجاه عندما/إذا تم نقل الموضوع إلى رسالة خاصة؟ في بعض الأحيان، يطلب أعضاؤنا إعادة تعيين كلمات المرور ونود مواصلة المحادثة داخل المجتمع.

لقد جربت العملية المذكورة أعلاه، وهي تعمل بشكل جيد! :partying_face: ومع ذلك، هناك مشكلة عندما يحتوي تعليق في Zendesk على مرفق - تصل الرسالة، ولكن المرفق مفقود. لست متأكدًا مما إذا كانت هناك معلمة إضافية يجب تمريرها في الـ webhook للتعامل مع المرفقات. هل يمكن لأحد أن يوضح ما إذا كانت هناك أي معلمات محددة مطلوبة لهذا الغرض؟

شكرا لك!

لقد قمت للتو بإعداد إضافة Zendesk وهي تعمل بشكل رائع. أود تمكين المزامنة ثنائية الاتجاه للتعليقات، لكنني لا أرغب في إنشاء تذكرة Zendesk تلقائيًا… في أي وقت مضى، في الواقع.

يبدو أن مزامنة التعليقات من ZD->Discourse تتطلب تمكين الإنشاء التلقائي. هل هذا هو الحال، أم أن هناك حلًا بديلاً؟

لقد قمت بتمكين إضافة Zendesk ويعمل إرسال التذاكر إلى Zendesk. ولكن الـ Webhook في التوثيق أعلاه (https:///zendesk-plugin/sync) يُرجع 404 عند اختباره من صفحة إعداد Webhook في Zendesk. بالتالي، لا يمكنني تحديث منشورات المنتدى من Zendesk. ما الذي أفعله بشكل خاطئ؟

مشكلة أخرى: إذا أغلقت التذكرة على Zendesk وقام شخص ما بالرد على منشور Discourse، فلن تتم إعادة فتح التذكرة المغلقة وسأفقد المنشور الجديد. أي تلميحات؟

مرحباً أوليفر،

أنا متأكد من أنك أدركت ذلك بالفعل، ولكن عنوان URL للمزامنة يحتاج إلى تضمين نطاقك. لذا بدلاً من مجرد https:///zendesk-plugin/sync قد يكون شيئًا مثل هذا: https://forum.yoursite.com/zendesk-plugin/sync.

حتى بعد تعيين التذكرة على “تم الحل”، يجب أن تظل ترى أي رد من Discourse على تذكرة ZD. سيتعين عليك فقط البحث عن التذكرة. :slight_smile:

على سبيل المثال، في موقع الاختبار الخاص بي قمت بإنشاء منشور ومنه تذكرة في ZD. قمت بتعيين التذكرة على “تم الحل” ثم نشرت ردًا على الموضوع على Discourse. تلقيت تعليقًا على تذكرة ZD: