{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":33071,"path":"it-service-management/itsm-success-dashboard-indicators/update-live-agent-script-include.md","title":"Update the live agent script include","bundle":null,"doc_type":null,"release":"australia","body":"\n# Update the live agent script include\n\nLive 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\\). While we configure these deflections, we need to update the live agent script include. Update the SSADeflectionHelper script to override the *checkInteraction* function.\n\n## Before you begin\n\nRole required: admin\n\n## About this task\n\nAn agent interaction is where the interaction is not through a virtual agent interaction. The interaction could be through Walk up experience, phone, video or with 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.\n\nThe SSADeflectionHelper script overrides the check interaction function and helps in setting up the live agent interaction.\n\n## Procedure\n\n1.  Navigate to **All** &gt; **System Definition** &gt; **Script Includes**.\n\n2.  Open the SSADeflectionHelper script include and modify the script as follows.\n\n    1.  Override the function *checkInteraction* from SSADeflectionHelperSNC\n\n        ```\n        checkInteraction: function(openedFor, windowStart, windowEnd) {\n                var interactionRecord = new GlideRecord('interaction');\n                // Pulling Virtual Agent User sysId from com.glide.cs.va.sys_user property\n                var vaUser = gs.getProperty('com.glide.cs.va.sys_user');\n                var windowConditions = 'opened_for=' + openedFor + '^sys_created_on>=' + windowStart + '^sys_created_on<=' + windowEnd;\n                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';\n                var encodedQuery = windowConditions + '^' + interactionConditions;\n                interactionRecord.addEncodedQuery(encodedQuery);\n                interactionRecord.setLimit(1);\n                interactionRecord.query();\n                if (interactionRecord.next()) {\n                    return true;\n                }\n                return false;\n            },\n        ```\n\n    2.  Update the following line to update the live agent interaction conditions:\n\n        ```\n        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';\n        ```\n\n    \\[Omitted image \"liveagent-script-include.png\"\\] Alt text: Live agent script include\n\n\n**Parent Topic:**[ITSM Success Dashboard Admin console](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-service-management/itsm-success-dashboard-indicators/admin-console-sd.md)\n\n"}}