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.
Entitlement script for catalog items still being evaluated when commented out - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • Entitlement script for catalog items still being evaluated when commented out
KB0551760

Entitlement script for catalog items still being evaluated when commented out


2873 Views Last updated : Apr 7, 2024 public Copy Permalink
KB Summary by Now Assist

Description

If an entitlement script is added to a catalog item, although commented out, it is still evaluated to false and causes the item to be hidden.
It also overrides any other types of entitlements like Available for group.

Steps to Reproduce

In Fuji or Geneva perform following setup:

  1. Turn off the property glide.sc.use_user_criteria and set to false.
  2. Visit a catalog item and add a group under Available for groups.
  3. Ensure that the group does not contain any special roles as they might override the error behavior.
  4. Add a newly created user to the group.
  5. Impersonate the user added to the group.
    The catalog item should be available in the service catalog.
  6. Stop impersonating the user.
  7. Open the catalog item.
  8. Add Entitlement script to the form.
  9. Add an entitlement script that evaluates to true and then comment it out. For example:

/*
answer = true;

*/

This evaluates to false, when it should behave exactly like an empty value and evaluate to true.

Workaround

Having no code and just comments in the Entitlement Script results in returning a false condition and hiding the items. The workaround is to have an empty value and not just comments.

Ideally only comments should work as empty value and should return true value, so that the item is always visible. But this would not be fixed as entitlements is legacy behavior replaced by user criteria.


Related Problem: PRB648652

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.