Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
Email Notifications containing an Advanced Condition with last statement gs.log call will not execute - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • Email Notifications containing an Advanced Condition with last statement gs.log call will not execute
KB0623384

Email Notifications containing an Advanced Condition with last statement gs.log call will not execute


10249 Views Last updated : Jan 24, 2025 public Copy Permalink
KB Summary by Now Assist

Description

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;
gs.log("ServiceNow test");

On the other hand, this condition returns TRUE because the last statement evaluates to TRUE:

gs.log("ServiceNow test");
answer = true;

Steps to Reproduce

 

Create a notification with the following advanced condition:
answer = true;
gs.log("ServiceNow test");

Note that the email notification never triggers even though the log 'ServiceNow test' is logged in the [syslog] table.

Workaround

After carefully considering the severity and frequency of the issue, and the cost and risk of attempting a fix, it has been decided to not address this issue in any current or near future releases. We do not make these decisions lightly, and we apologize for any inconvenience.

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:

gs.log("ServiceNow test");
answer = true;

Note that nothing is special about the variable named 'answer' in this context. The last statement must evaluate to true to pass the conditions.

 

See also related PRB704806/KB0623377 - Email Notifications with only comments in the advanced condition do not trigger because the condition is evaluate to false


Related Problem: PRB925562

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.