117 views

Description

During the upgrade process, executing custom business rules that use API: "var rota = new OnCallRotation(current)" results in error SncOnCallRotation is not defined. (sys_script_include.00de3ea6c0a81701018849faa834ee9c; line 9)

org.mozilla.javascript.EcmaError: "SncOnCallRotation" is not defined. Caused by error in script at line 9

Steps to Reproduce

 

  1. On a pre-Helsinki instance (for example, Geneva), activate the On-Call Scheduling plugin.

    For more information, see the product documentation topic Activate a plugin.

  2. Start the upgrade process to Helsinki.

  3. Navigate to System Definition > Scripts - Background, and run the following code:

    var group = "287ebd7da9fe198100f92cc8d1d2154e"; // demo data group: network

    var rota = new OnCallRotation();

    if (rota.who(group)) {

        var gr = new GlideRecord("sys_user");

        gr.get(rota.getPrimaryUser() + "");

        gs.log(gr.name);

    }

    Note that instead of the expected message *** Script: ITIL User, the following message appears:

    Evaluator: org.mozilla.javascript.EcmaError: "SncOnCallRotation" is not defined. Caused by error in script at line 9

 

Workaround

Modify the Script Include name OnCallRotation sys_id: 00de3ea6c0a81701018849faa834ee9c by changing:

this.onCallRota = new SncOnCallRotation();

to:

this.onCallRota = (typeof SncOnCallRotation != "undefined" ) ? new SncOnCallRotation() : new SNC.OnCallRotation();

 

 


Related Problem: PRB913812

Seen In

Helsinki

Fixed In

Jakarta

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2017-10-16 12:32:19
Published:2017-04-05