Configure a Listener to trigger an action when an event occurs in an external application. This example shows how to create a Task Bot with a Listener trigger to send an email to a Microsoft 365 Outlook mailbox when a user creates a ticket in Zendesk platform.

The trigger listens for any events in the Zendesk platform. When the user creates a ticket in the platform, the trigger starts the subsequent automation workflow to send an email containing the ticket details to the configured Microsoft 365 Outlook mailbox.

Prerequisites

Ensure that you meet the following prerequisites:
  • A listener URL for the automation. For more information about creating listener URLs, see Creating listener URL for Listener web trigger.
  • Administrator privileges for Zendesk platform to create, update, and delete tickets.
  • Listener trigger requirements listed in Listener trigger.
  • A record variable named TriggerData.
  • Active OAuth connection for Microsoft 365 Outlook.
  • A credential variable that contains the Microsoft 365 Outlook username.

Procedure

  1. Perform the following steps to create a webhook in the Zendesk platform.
    1. Log in to your Zendesk portal
    2. Go to Admin Center > Apps and integrations > Webhooks and then click Create webhook.
    3. Enter the following in the appropriate fields.
      1. Select a way to connect: Select Zendesk events and choose Any ticket events from the event types drop-down list.
      2. Name: Enter an appropriate name for the webhook.
      3. Endpoint URL: Add the listener URL that you create in Control Room.
      4. Authentication: Select API key.
      5. Header name: Enter ticket-header.
      6. Value: Enter an appropriate value for the header.
      For more information about creating webhooks, seeCreating webhooks in Zendesk.
  2. Perform the following steps to create a Task Bot in Control Room.
    1. On the left pane, click Automation.
    2. Click Create > Task Bot.
      The Create Task Bot wizard appears.
    3. Enter an appropriate name for the bot in the Name field.
      The system stores all the bots in <\Bots> folder by default.
    4. Optional: Add a description for the bot in the Description field.
    5. Optional: Click Choose and follow the prompts to save the bot in a different folder.
    6. Click Create & Edit.
      The bot is created and the Edit Task Bot appears.
  3. Perform the following steps to add and configure the Listener web trigger.
    1. Click Triggers > Universal web trigger, and then double-click or drag Listener to add the web trigger to Triggers section.
    2. Select the generated listener URL from the Listener drop-down list.
      The system auto-populates the generated URL in the URL field.
    3. Click Add in the Authentication headers to open the Headers modal.
    4. Enter the authentication header name in Name.
    5. Select Insecure string and enter the value of the header in Value.
      Alternatively, you can save the value as a credential in Credential Vault and use the Credential option to select the value.
    6. Click Add to add the authentication header.
    7. Select No validation from the Signature scheme drop-down.
    8. Select TriggerData from the Response drop-down.
      The TriggerData variable stores the incoming response payload from Zendesk. For more information about the ticket events response payload, see Zendesk ticket events payloads.
  4. Perform the following steps to add and configure the Microsoft 365 Outlook Connect action.
    1. Click Actions > Microsoft 365 Outlook, and then double-click or drag Connect to add the action to Actions section.
    2. Select Azure Global in Azure Cloud.
      If your Microsoft 365 Outlook is part of Microsoft 365 Government version, choose Azure US GCC High.
    3. Select Control Room managed in OAuth2 Authentication mode.
    4. Click Pick and follow the prompts in Pick an OAuth connection modal to choose the OAuth connection for Microsoft 365 Outlook.
    5. Click Variable > Insert a value and follow the prompts to choose the Microsoft 365 Outlook username credential.
    6. Optional: Enter an appropriate session name in Create Microsoft 365 Outlook session.
      The system sets Microsoft365OutlookSession as the session name by default.
  5. Perform the following steps to add and configure the Microsoft 365 Outlook Send action.
    1. Click Actions > Microsoft 365 Outlook, and then double-click or drag Send to add the action to Actions section.
    2. Enter the session name that you had entered when configuring the Connect action.
      If the default name is retained, the system prefills Microsoft365OutlookSession as the Microsoft 365 Outlook session.
    3. Enter the Microsoft 365 Outlook mail id to which the file details must be forwarded in To.
    4. Enter $TriggerData{"detail.subject"}$ in Subject.
      The detail.subject key contains the subject of the Zendesk ticket as its value.
    5. Select HTML code in Email body type and enter the $TriggerData{"detail.description"}$.
      The detail.description key contains the description of the Zendesk ticket as its value.
  6. Click Save to save the configuration.
When you click Run > Run with triggers, the system activates the trigger and the trigger starts listening for the ticketing events in Zendesk platform. When a user creates a ticket, the trigger starts the subsequent Microsoft 365 Outlook actions. The Microsoft 365 Outlook mailbox receives a mail with ticket subject as the email subject and ticket description as the mail body.