Notifications

3 views

Symptoms

Unable to encrypt attachments using a bulk encryption script from documentation (https://docs.servicenow.com/bundle/kingston-platform-administration/page/script/server-scripting/concept/c_EncryptionScripting.html). 

The script throws an error stating:

org.mozilla.javascript.EcmaError: Cannot find function changeEncryptionContext in object [object GlideSysAttachment]

Release

All

 

Cause

The cause may be that the execution of the script is being done in the same scope as the table containing the attachment

Resolution

The execution of the script needs to be done in the global scope either as a background script, UI Action or Business rule. 

The encryption context and associated sys_user_role can be in either global scope or in the scope of the table, but the execution of the script needs to be in global scope.

 

Article Information

Last Updated:2019-05-21 11:59:03
Published:2019-05-14