Advanced conditions for email notifications

Use an advanced condition to send a notification based on the current email record, changing field values, or system properties.

The advanced condition script must set the answer variable to true to send the notification. For example, to prevent the system from sending an email notification if the sender of a self-service request is a member of the XYZ group, use this code:

var groupMember = gs.getUser();
if(groupMember.isMemberOf('XYZ')){
answer = false;
}
else{
answer = true;
}

You can add a script-based condition in the Advanced condition field by configuring the Email Notification form and adding the field. You can access the field in the Advanced view without configuring the form.

The advanced condition script uses the following business rule global variables:
  • current: contains the current record from the table to which the notification is linked.
  • event: contains the event that triggered the notification.
Note: The Advanced condition field is evaluated in addition to other conditions you set on the notification. Both the Condition and Advanced condition must evaluate to true in order to send the notification.