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.
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. Theimage above is a suggestion of how to create a flow with the availability webhook and custom variables.
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, but before you can do that, you will need to navigate to the webhook marketplace and use the "Zendesk Chat Agent Availability" Webhook Template to create your own webhook.
After selecting the template, the only value that 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".
Please be aware that the name of the department in Zendesk cannot have any spaces init, and that 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.
How to insert 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.
Please see the image below for learning how to structure the "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 thatis returned when firing the Zendesk Chat Agent Availability webhook. It will have to be changed depending on which department name that 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 if it’s true that there’s an agent available, then the chatbot should send the user to the "Zendesk Chat Handover to Agent Webhook" module, and if it’s false that there’s someone available then the user will be sent to the "No Agent Available" module.
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 "Zendesk 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 "Zendesk Chat Handover to Agent" Webhook Template. As you've done previously with the "Zendesk Chat Agent Availability" Webhook Template, you will need to insert the name of the department that you want to transfer the user to.
Please be aware that the name of the department in Zendesk cannot have any spaces in it, and that 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.
How to insert the handover webhook
To insert the handover 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.
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 that a notification appears iswhen 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.