Executing an action that triggers the On-Call Assign workflow produces an error in the logsDescription<!-- div.margin{ padding: 10px 40px 40px 30px; } table.tocTable{ border: 1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); padding-top: .6em; padding-bottom: .6em; padding-left: .9em; padding-right: .6em; } table.noteTable{ border:1px solid; border-color:#E0E0E0; background-color: rgb(245, 245, 245); width: 100%; border-spacing:2; } table.internaltable { white-space:nowrap; text-align:left; border-width: 1px; border-collapse: collapse; font-size:14px; width: 85%; } table.internaltable th { border-width: 1px; padding: 5px; border-style: solid; border-color: rgb(245, 245, 245); background-color: rgb(245, 245, 245); } table.internaltable td { border-width: 1px; padding: 5px; border-style: solid; border-color: #E0E0E0; color: #000000; } .title { color: #D1232B; font-weight:normal; font-size:28px; } .spanColor { color: #646464; } h1{ color: #D1232B; font-weight:normal; font-size:21px; margin-bottom:-5px } h2{ color: #646464; font-weight:bold; font-size:18px; } h3{ color: #000000; font-weight:BOLD; font-size:16px; text-decoration:underline; } h4{ color: #646464; font-weight:BOLD; font-size:15px; text-decoration:; } h5{ color: #000000; font-weight:BOLD; font-size:13px; text-decoration:; } h6{ color: #000000; font-weight:BOLD; font-size:14px; text-decoration:; } hr{ border-top-width: 1px; border-top-style: solid; border-top-color: #cccccc; } ul { list-style: disc outside none; margin-left: 0; } li { padding-left: 1em; } --> Executing an action triggering the On-Call Assign workflow produces the following error in the logs: Is there any schedule at the time?(be827be2db7103001d80d001cf961926): org.mozilla.javascript.WrappedException: Wrapped ReferenceError: "vars" is not defined. (answer = ifScript(); function ifScript() { var rota = new SNC.OnCallRotation(); var gdt = new GlideDateTime(); var escalationPlan = rota.getEscalationPlan(vars.assignment_group.sys_id.toString(), gdt); if (JSUtil.nil(rota) || JSUtil.nil(rota.getCurrentRotaID())) { return 'no'; } return 'yes'; } ; line 6) (<refname>; line 51) CauseThe On-Call: Assign workflow is designed to be triggered by creating a New Call of type Incident, and clicking Submit. The system then searches the Trigger Rules table and starts the workflow based on conditions. When you create an Incident directly from the Incidents module, you cannot use the On-Call: Assign workflow. Instead, you need to create a workflow that runs when your condition is matched. The Process Trigger Rule Script action is in charge of setting the value of var vars = {}; vars.assignment_group = rule.group; if this is not set, then the workflow fails when running the line: var escalationPlan = rota.getEscalationPlan(vars.assignment_group.sys_id.toString(), gdt); The event kicks off only when creating a new incident through the new_call record, which kicks off automatically if the New Call record is of type Incident. Resolution Navigate to the Process Trigger Rule script action: https://<instance>/nav_to.do?uri=sysevent_script_action.do?sys_id=2d7a7000eb301100fcfb858ad106fe42 Use guard code such that the workflow could be triggered as intended (via trigger rules), with vars passed to workflow and change the var escalationPlan = rota.getEscalationPlan(vars.assignment_group.sys_id.toString(), gdt); so it acquires the assignment_group directly from the incident after the trigger rule has made the assignment: var assignmentGroupSysId = "" if (typeof vars !== "undefined" && vars && vars.assignment_group) else assignmentGroupSysId = current.assignment_group.sys_id.toString(); var escalationPlan = rota.getEscalationPlan(assignmentGroupSysId, gdt);