Abilitazione della sincronizzazione bidirezionale di 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 Mi Piace

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 Mi Piace

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 Mi Piace

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

Ciao! Ho impostato tutto ma funziona solo da Discourse a Zendesk. Non so cosa mi manca affinché le mie risposte in Zendesk possano essere pubblicate in Discourse

Ciao, sono con Marla qui ^^^. Siamo riusciti a far funzionare il plugin! :tada:

Ma ci stiamo chiedendo: c’è un modo per continuare la sincronizzazione bidirezionale quando/se l’argomento viene spostato in un messaggio privato? A volte, i nostri membri chiederanno il ripristino delle password e vorremmo continuare la conversazione all’interno della community.

Ho provato il processo sopra e funziona bene! :partying_face: Tuttavia, c’è un problema quando un commento in Zendesk contiene un allegato: il messaggio arriva, ma l’allegato manca. Non sono sicuro se ci sia un parametro aggiuntivo che debba essere passato nel webhook per gestire gli allegati. Qualcuno potrebbe chiarire se sono necessari parametri specifici per questo?

Grazie!

Ho appena configurato il plugin Zendesk e funziona benissimo. Vorrei abilitare la sincronizzazione bidirezionale per i commenti, ma non voglio che venga generato automaticamente un ticket Zendesk… mai, in realtà.

Sembra che la sincronizzazione dei commenti da ZD->Discourse richieda l’abilitazione della generazione automatica. È così, o esiste una soluzione alternativa?

Ho abilitato il plugin Zendesk e l’invio di ticket a Zendesk funziona. Ma il Webhook nella documentazione sopra (https:///zendesk-plugin/sync) restituisce un 404 quando lo testo dalla pagina di configurazione del Webhook di Zendesk. Di conseguenza, non posso aggiornare i post del forum da Zendesk. Cosa sto sbagliando?

Un altro problema: se chiudo il ticket su Zendesk e qualcuno risponde al post di Discourse, il ticket chiuso non viene riaperto e perdo il nuovo post. Qualche suggerimento?

Ciao Oliver,

Sono sicuro che te ne sei già reso conto, ma l’URL di sincronizzazione deve includere il tuo dominio. Quindi, invece di https:///zendesk-plugin/sync, potrebbe essere qualcosa di simile a: https://forum.yoursite.com/zendesk-plugin/sync.

Anche dopo aver impostato il ticket su “Risolto”, dovresti comunque vedere qualsiasi risposta di Discourse sul ticket ZD. Dovrai solo cercare il ticket. :slight_smile:

Ad esempio, sul mio sito di prova ho creato un post e da esso un ticket in ZD. Ho contrassegnato il ticket come “Risolto” e poi ho pubblicato una risposta all’argomento su Discourse. Ho ricevuto un commento sul ticket ZD: