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.
Pattern Pre/Post Scripts in "Discovery and Service Mapping Patterns" scoped app are referencing "script include" accessible only in "Global" - Known Error
  • >
  • Knowledge Base
  • >
  • Known Error (Knowledge Base)
  • >
  • Pattern Pre/Post Scripts in "Discovery and Service Mapping Patterns" scoped app are referencing "script include" accessible only in "Global"
KB0827636

Pattern Pre/Post Scripts in "Discovery and Service Mapping Patterns" scoped app are referencing "script include" accessible only in "Global"


3904 Views Last updated : Oct 13, 2022 public Copy Permalink
KB Summary by Now Assist

Description

There are several Pattern Pre/Post Scripts in "Discovery and Service Mapping Patterns" scoped app which are referencing "script include" accessible only in "Global".
As a result, the corresponding pattern using this script will fail during Discovery.
Example: Network Switch pattern failed with the error message: "Running pre sensor script- WAPs - Pre failed due to: TypeError: Cannot convert null to an object."
This is caused by Pre/Post Pattern Scripts "WAPs - Pre" which is in "Discovery and Service Mapping" scope is referencing to "MakeAndModelJS" and "JSUtil" script includes which are in "Global" scope.

Steps to Reproduce

  1. Install Discovery and Service Mapping patterns version 1.0.63.
  2. Run Discovery on Wireless Access Point devices.
  3. Observe that the Network Switch pattern failed with the error message: "Running pre sensor script- WAPs - Pre failed due to: TypeError: Cannot convert null to an object."

Workaround

This problem is currently under review. You can contact ServiceNow Technical Support or subscribe to this Known Error article by clicking the Subscribe button at the top right of this form to be notified when more information will become available..

If you can not wait to upgrade to the release version containing the fix, you can use the following steps to solve the issue (based on WAPs - Pre example):

  1. Change the "Accessible from" flag on JSUtil and MakeAndModelJS from "This application scope only" to "All application scopes".
  2. Modify the Pattern Pre/Post Scripts "WAPs - Pre" by adding "global." in front of the occurrences of "JSUtil" and "MakeAndModelJS".

Related Problem: PRB1409305

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.