Notifications

1684 views

Description

After upgrading to London, getGlideObject gives error "Evaluator: org.mozilla.javascript.EcmaError: Cannot convert null to an object".

 

Release or Environment

London or higher

Cause

getGlideObject is an internal, undocumented class and it is not supposed to be used externally.

The reason why it worked in pre-London is that, starting from London, Variable Sets have been elevated to be a first class citizen in Service Catalog, which means that variable sets are now accessible via script.

Resolution

You don't have to use getGlideObject and can access the variables directly.

To resolve the behavior faced, please utilize a Script like the following:

if (gr.description == '')
{
var variables = current.variables.getElements();
for(var i=0;i<variables.length;i++)
{
var v = variables[i].getQuestion();
gr.description += v.getLabel() + " - " + v.getValue() + "\n";
}
}
gr.update();

 

Article Information

Last Updated:2019-12-03 08:31:29
Published:2019-11-28