Update the live agent script include

task australia Updated Sep 10, 2026 1 min read update-live-agent-script-include.md
Raw file servicenow.com

Live agent configuration is used in the self-solved deflections (Deflection using KB articles, Deflection using QnA AIS, Deflection using QnA LLM, and Deflection using ITSM VA). When you configure these deflections, update the live agent script include. Update the SSADeflectionHelper script to override the checkInteraction function.

Before you begin

Role required: admin

About this task

An agent interaction is where the interaction is not through a virtual agent interaction. The interaction could be through Walk up experience, phone, video, or a live agent. The base system instrumentation checks whether the employee created an incident or interacted with an agent after reading an article or interacting with a Virtual Agent.

The SSADeflectionHelper script overrides the checkInteraction function and helps in setting up the live agent interaction.

Procedure

  1. Navigate to All > System Definition > Script Includes.

  2. Open the SSADeflectionHelper script include and modify the script as follows.

    1. Override the function checkInteraction from SSADeflectionHelperSNC

      JavaScript
      checkInteraction: function(openedFor, windowStart, windowEnd) {        var interactionRecord = new GlideRecord('interaction');        // Pulling Virtual Agent User sysId from com.glide.cs.va.sys_user property        var vaUser = gs.getProperty('com.glide.cs.va.sys_user');        var windowConditions = 'opened_for=' + openedFor + '^sys_created_on>=' + windowStart + '^sys_created_on<=' + windowEnd;        var interactionConditions = 'virtual_agent!=true^ORstateINon_hold,closed_abandoned^ORsys_created_by=system^ORopened_for.web_service_access_only!=false^opened_for.web_service_access_onlyISNOTEMPTY^ORopened_for.internal_integration_user!=false^opened_for.internal_integration_userISNOTEMPTY^assigned_to!=' + vaUser + '^ORassigned_to=NULL';        var encodedQuery = windowConditions + '^' + interactionConditions;        interactionRecord.addEncodedQuery(encodedQuery);        interactionRecord.setLimit(1);        interactionRecord.query();        if (interactionRecord.next()) {            return true;        }        return false;    },
    2. Update the following line to update the live agent interaction conditions:

      JavaScript
      var interactionConditions = 'virtual_agent!=true^ORstateINon_hold,closed_abandoned^ORsys_created_by=system^ORopened_for.web_service_access_only!=false^opened_for.web_service_access_onlyISNOTEMPTY^ORopened_for.internal_integration_user!=false^opened_for.internal_integration_userISNOTEMPTY^assigned_to!=' + vaUser + '^ORassigned_to=NULL';

    [Omitted image "liveagent-script-include.png"] Alt text: Live agent script include

Parent Topic:ITSM Success Dashboard Admin console

Search documentation
Search document titles and file paths on the australia branch