Check agent availability and hand the user over in Zendesk

To avoid any unfortunate situations arising when handing over an end user to an agent in Zendesk, it is essential to check whether the agent is available first. This article will explain how to check the availability of an agent in Zendesk, and how to hand the conversation over to an agent in Zendesk, provided that an agent is available. Below, you'll find the following topics:

An example of a communication flow when checking agent availability and taking over an end user

To use the Availability Webhook, you will need to create a flow where the Webhook is in one Module and the Custom Variables are in another Module. Having the Webhook and Custom Variables in two separate Modules ensures that there is enough time to validate the Webhook. The following image shows a suggestion of how to create a flow with the Availability Webhook and Custom Variables:

Availability-and-Handover-graphic.gif

Please be aware that the handover to a human agent will not take place if there are no online agents in the destination Zendesk department, so you must check the department's availability first.

Creating the Availability Webhook

In the first Module, you will have to insert the Availability Webhook in the Module’s connections. Before you can do that, you will need to navigate to the Webhook Marketplace and use the wh_iconZendesk Chat Agent Availability Webhook Template to create your own Webhook. 

After selecting the template, the only value you need to define is the department that the user will be handed over to. This department has to be the one that your human agents use, and it has to be different from the department that your bot is in. If they are in the same department, you will not be able to use the handover functionality.

For the purpose of this article, we will be using the department name "Bot_Operator".

screenshot-me.botxo.co-2019.08.20-12_55_48.png

Please be aware that the name of the department in Zendesk cannot have any spaces in it, and it is case-sensitive. After defining the department, it is advisable to rename the Webhook to something more recognizable. Hit "Save Webhook", and you're done.

Inserting the Availability Webhook

To insert the Availability Webhook into a Module, you must have already created it in the previous step. It will not show up otherwise. After creation, Webhooks are selectable in the drop-down menu, as displayed in the example below.

Add-Availability-Webhook.gif

Below, you can see the process and image for how to structure the <md>Bot Asks User About Transfer Module and how to add Custom Variables.

Before transferring the end user to a human, it is advisable to check whether they want to be transferred. 

The Custom Variable Bot_Operator_availability is the variable returned when firing the wh_iconZendesk Chat Agent Availability Webhook. It will have to be changed depending on which department name you have defined when creating the Webhook. 

Remember to set the matcher rules to “Exactly match”, and add “True” or “False” to the “Add value” space. This will ensure that 1) if it’s true, there is an agent available, then the chatbot should send the user to the <md>Zendesk Chat Handover to Agent Webhook Module, and 2) if it’s false, there is not anyone available, then the user will be sent to the <md>No Agent Available Module.

Bot-Op-Availability.gif

Please be aware that there is a limitation when using the availability Custom Variables in a Module. You cannot use the function "Don't wait for the user's reply, just evaluate the Connections" in the same Module as the one where you call the availability Custom Variables.

If an agent is available, and the end user has responded with "Yes" to whether they'd like to be transferred, you can make use of the wh_iconZendesk Chat Handover to Agent Webhook Template to transfer them. 

Creating the Handover Webhook

The Handover Webhook ensures that an agent is notified in the Zendesk dashboard when there is a conversation they must respond to.

To create the Handover Webhook, you will need to navigate to the Webhook Marketplace and select the wh_iconZendesk Chat Handover to Agent Webhook Template. As you've done previously with the wh_iconZendesk Chat Agent Availability Webhook Template, you will need to insert the name of the department that you want to transfer the user to.

screenshot-me.botxo.co-2019.08.20-15_59_00.png

Please be aware that the name of the department in Zendesk cannot have any spaces in it, and it is case-sensitive. After defining the department, it is advisable to rename the Webhook to something more recognizable. Hit "Save Webhook", and you're done.

Inserting the Handover Webhook

To insert the Handover Webhook into a Module, you must have already created it in the previous step, otherwise, it will not show up. After creation, Webhooks are selectable in the drop-down menu, as displayed in the example below:

Insert-Handover-Webhook.gif

After firing the Webhook, there will be no notification in the chat signifying that the user has been handed over to the agent. The only time a notification appears is when the agent opens the chat window. Therefore, you should add some text in the Bot Message to inform the end user that they might be expected to wait a few minutes.

You should also ensure that your Session Expiry is set to more than a few minutes. Otherwise, you might face issues if your human agents take longer than expected to respond to the end user.