Habilitación de la sincronización bidireccional de 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 Me gusta

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 Me gusta

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 Me gusta

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

¡Hola! Configuré todo pero solo funciona de Discourse a Zendesk. No sé qué me falta para que mis respuestas en Zendesk se publiquen en Discourse.

Hola, estoy con Marla aquí ^^^. ¡Logramos que el plugin funcionara! :tada:

Pero nos preguntamos: ¿hay alguna forma de continuar la sincronización bidireccional cuando/si el tema se mueve a un mensaje privado? A veces, nuestros miembros solicitan restablecer contraseñas y nos gustaría continuar la conversación dentro de la comunidad.

¡He probado el proceso anterior y funciona bien! :partying_face: Sin embargo, hay un problema cuando un comentario en Zendesk contiene un archivo adjunto: el mensaje llega, pero el archivo adjunto falta. No estoy seguro si hay un parámetro adicional que deba pasarse en el webhook para manejar los archivos adjuntos. ¿Alguien podría aclarar si se requieren parámetros específicos para esto?

¡Gracias!

Acabo de configurar el plugin de Zendesk y funciona muy bien. Me gustaría habilitar la sincronización bidireccional para los comentarios, pero no quiero que se genere automáticamente un ticket de Zendesk… realmente, nunca.

Parece que la sincronización de comentarios de ZD → Discourse requiere habilitar la generación automática. ¿Es así, o hay alguna solución alternativa?

He habilitado el plugin de Zendesk y la publicación de tickets en Zendesk funciona. Pero el Webhook en la documentación anterior (https:///zendesk-plugin/sync) devuelve un 404 cuando lo pruebo desde la página de configuración de Webhook de Zendesk. Posteriormente, no puedo actualizar las publicaciones del foro desde Zendesk. ¿Qué estoy haciendo mal?

Otro problema: Si cierro el ticket en Zendesk y alguien responde a la publicación de Discourse, el ticket cerrado no se vuelve a abrir y me pierdo la nueva publicación. ¿Alguna pista?

Hola Oliver,

Estoy seguro de que ya te has dado cuenta, pero la URL de sincronización necesita incluir tu dominio. Así que en lugar de solo https:///zendesk-plugin/sync, podría ser algo como esto: https://forum.yoursite.com/zendesk-plugin/sync.

Incluso después de configurar el ticket como “Resuelto”, deberías poder ver cualquier respuesta de Discourse en el ticket de ZD. Solo tendrás que buscar el ticket. :slight_smile:

Por ejemplo, en mi sitio de prueba creé una publicación y a partir de ella un ticket en ZD. Marqué el ticket como “Resuelto” y luego publiqué una respuesta al tema en Discourse. Recibí un comentario en el ticket de ZD: