Notifications

4 views

Description

A Notification defined within an Application Scope, other than "global", and which has an Advanced Condition Script may send an email incorrectly if the Script uses the global variable "answer".

Cause

This is due to the global variable "answer" being unavailable to the Script, and it will cause the following error in the System Logs:

org.mozilla.javascript.EcmaError: Assignment to undefined "answer" in strict mode

Resolution

There are two methods provided in the Advanced conditions for email notifications Doc page, one using the "answer" variable, and the other is to create a function that returns the true/false value.

 

When you have a Notification defined in an Application Scope, you will need to modify the Advanced Condition Script to use the function method, e.g.

(function() {
  var groupMember = gs.getUser();
  return !groupMember.isMemberOf('XYZ');
})();

 

Article Information

Last Updated:2019-11-26 19:06:38
Published:2019-11-27