Identity Portal javascript handler fails with "importPackage" is not defined error

Document ID : KB000074733
Last Modified Date : 23/03/2018
Show Technical Document Details
After upgrading Identity Portal a previously working javascript handler is failing with "ReferenceError: 'importPackage' is not defined in <eval>"
Identity Portal 14.x
This issue is not actually caused by Identity Portal, but rather by the JVM that the Identity Portal is running against. After 14.x, Portal is only supported on Java 1.8.x.

As of Java 1.8, the javascript scripting engine has changed from Rhino to Nashorn.
To resolve this, you'll need to add this line to the beginning of your scripts for compatibility: