Contact center admins can add and edit event scripts in the Start widget. This allows you to create scripts and associate them with an engagement event. For example, you can run a custom script for when an agent saves a disposition.
This article covers:
The following events can be set in the Start widget.
Event | Description | Channels that the event is available for |
Engagement accepted | When an agent accepts the call. | voice, video |
Engagement assigned | When an agent accepts an SMS or chat engagement. | SMS, web chat, in-app chat |
Engagement closed | An engagement has closed. For example, the agent or consumer has ended/left the video or voice call. | voice, video, SMS, web chat, in-app chat |
Engagement recording started | Recording for the engagement has started. | voice |
Engagement recording ended | Recording for the engagement has ended. | voice |
Engagement transcription started | Transcription for the engagement has started. | voice |
Engagement transcription ended | Transcription for the engagement has ended. | voice |
Engagement started | An engagement starts in the flow. | voice |
Engagement transferred | An engagement is transferred to another agent. | voice, video, SMS, web chat, in-app chat |
Disposition saved | An agent saved a disposition. | voice, video, SMS, web chat, in-app chat |
Voicemail saved | Consumer leaves voicemail for the engagement. | voice |
Refer to the Script widget support article for more information on using variables.
Enter the following script code in the Event script to populate a local variable in your script code with the consumer's phone number.
let caller_number = var_get()["global_system.Engagement.ANI"];
Note: Certain system variables are only populated in certain channges. For example, the above ANI variable is populated for voice channel engagements but not web chat or video channel engagements.
Below are some commonly used Global Variables that can be used in event scripts. These variables are automatically populated by Zoom Contact Center during an active engagement.
Global System Variable Name | Data include in variable | When the global variable is populated with data |
global_system.Engagement.ANI | Consumer's phone number used to place the call | When a voice channel engagement starts |
global_system.Engagement.DNIS | Zoom Contact Center number that was dialed by the consumer | When a voice channel engagement starts |
global_system.Agent.displayName | Display name of the agent handling the engagement | When an agent answers the engagement, via the Engagement Accepted event, or during a transfer scenario via the Engagement transferred |
global_system.Agent.firstName | First name of the agent handling the engagement | When an agent answers the engagement, via the Engagement Accepted event, or during a transfer scenario via the Engagement transferred |
global_system.Agent.lastName | Last name of the agent handling the engagement | When an agent answers the engagement, via the Engagement Accepted event, or during a transfer scenario via the Engagement transferred |
global_system.Agent.email | Email of the agent handling the engagement | When an agent answers the engagement, via the Engagement Accepted event, or during a transfer scenario via the Engagement transferred |
global_system.Agent.userId | Zoom userid of the agent handling the engagement | When an agent answers the engagement, via the Engagement Accepted event, or during a transfer scenario via the Engagement transferred |
global_system.Engagement.queue | Name of the queue handling the engagement, if applicable | When an call is routed through a queue and answered by an agent, via the Engagement Accepted event, or during a transfer scenario via the Engagement transferred |
global_system.Engagement.authenticationStatus | A boolean variable that represents whether the consumer is authenticate according to the Consumer Authentication feature | When a web chat or video engagement starts using the ZCC Web SDK and is Consumer Authentication validation is successful. |
global_system.Engagement.engagementId | The engagement ID for this engagement | In all event scripts, including Engagement Started |
Note: The above table is an example of commonly used variables and does not represent all variables available, which will vary based on ZCC channel type. For more information please visit https://support.zoom.com/hc/en/article?id=zm_kb&sysparm_article=KB0059058
Note: the below agentName and agentEmail variables were used prior to the introduction of the above global variables. Customer using the below agentName and agentEmail variables should switch their code to use one of the above global variables.
let agentName = var_get()["agentName"];
let agentEmail = var_get()["agentEmail"];