In advanced conditions scripting, it is easy to overlook complex scripts that return FALSE because the last command evaluates to FALSE, so the email notification is not triggered.
For example, this advanced condition evaluates to FALSE because the last statement evaluates to FALSE:
|answer = true;|
On the other hand, this condition returns TRUE because the last statement evaluates to TRUE:
Steps to Reproduce
Create a notification with the following advanced condition:
answer = true;
Note that the email notification never triggers even though the log 'ServiceNow test' is logged in the [syslog] table.
As a workaround, because advanced condition scripts return the last operation's result, ensure that the script's last statement evaluates to TRUE.E.g.: for the use case in the steps to reproduce, you would change the script to:
Note that nothing is special about the variable named 'answer' in this context. The last statement must evaluate to true to pass the conditions.
Related Problem: PRB925562