Managing event scripts

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:

Prerequisites for managing event scripts

Events and associated channels

The following events can be set in the Start widget.

EventDescriptionChannels that the event is available for
Engagement acceptedWhen an agent accepts the call.voice, video
Engagement assignedWhen an agent accepts an SMS or chat engagement.SMS, web chat, in-app chat
Engagement closedAn 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 endedRecording for the engagement has ended.voice
Engagement transcription startedTranscription for the engagement has started.voice
Engagement transcription endedTranscription for the engagement has ended.voice
Engagement startedAn engagement starts in the flow.voice
Engagement transferredAn engagement is transferred to another agent.voice, video, SMS, web chat, in-app chat
Disposition savedAn agent saved a disposition.voice, video, SMS, web chat, in-app chat
Voicemail saved
Consumer leaves voicemail for the engagement.voice

How to add an event script

  1. Sign in to the Zoom web portal.
  2. In the navigation menu, click Contact Center Management then Flows.
  3. Click a flow's display name to edit it.
  4. Select the Start widget.
    The flow editor will display a right-side panel with the widget settings.
  5. Click Add Event Script.
  6. In the Event drop-down menu, select an event. There are different events depending on the channel of the flow.
  7. Next to Script, click Add Script, then specify these options:
  8. Click Add.
  9. Enter the input parameters and click Run to test the script.
  10. Click Close.

How to edit or delete an event script

  1. Sign in to the Zoom web portal.
  2. In the navigation menu, click Contact Center Management then Flows.
  3. Click a flow's display name to edit it.
  4. Select the Start widget.
    The flow editor will display a right-side panel with the widget settings.
  5. In the right-side panel, locate the event script you want to edit or delete.
  6. Click one these options for an event script:

How to use variables in an event script

Refer to the Script widget support article for more information on using variables.

Example

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.

Auto-populated Global Variables

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 NameData include in variableWhen the global variable is populated with data
global_system.Engagement.ANIConsumer's phone number used to place the callWhen a voice channel engagement starts
global_system.Engagement.DNISZoom Contact Center number that was dialed by the consumerWhen a voice channel engagement starts
global_system.Agent.displayNameDisplay name of the agent handling the engagementWhen an agent answers the engagement, via the Engagement Accepted event, or during a transfer scenario via the Engagement transferred
global_system.Agent.firstNameFirst name of the agent handling the engagementWhen an agent answers the engagement, via the Engagement Accepted event, or during a transfer scenario via the Engagement transferred
global_system.Agent.lastNameLast name of the agent handling the engagementWhen an agent answers the engagement, via the Engagement Accepted event, or during a transfer scenario via the Engagement transferred
global_system.Agent.emailEmail of the agent handling the engagementWhen an agent answers the engagement, via the Engagement Accepted event, or during a transfer scenario via the Engagement transferred
global_system.Agent.userIdZoom userid of the agent handling the engagementWhen an agent answers the engagement, via the Engagement Accepted event, or during a transfer scenario via the Engagement transferred
global_system.Engagement.queueName of the queue handling the engagement, if applicableWhen 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 featureWhen a web chat or video engagement starts using the ZCC Web SDK and is Consumer Authentication validation is successful.
global_system.Engagement.engagementIdThe engagement ID for this engagementIn 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


Legacy Variables


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"];