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.
How to pass discovery schedule fields to a CI record via discovery - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • How to pass discovery schedule fields to a CI record via discovery
KB0820001

How to pass discovery schedule fields to a CI record via discovery


2963 Views Last updated : Jan 3, 2025 public Copy Permalink
KB Summary by Now Assist

Summary

The location field is passed from a discovery schedule to the CIs discovered by it. Sometimes, other fields in the discovery schedule would be of interest to the CI discovered. This document goes over how the location field is passed from the discovery_schedule to the CI discovered and presents a possible option to replicate this behavior for other fields.

How does discovery pass the location field to discovered CIs?

  1. DiscoverySensor populates status via getAgentCorrelator() function.
  2. DiscoverySensor.getLocationID() populates location. Shazzam probe extends DiscoverySensor and thus has location available to it.
  3. Shazzam sensor populates cidata via updateLocation() function, called from process_inner() function.
  4. Once cidata is populate it will keep on being passed all the way until the CI is updated.

Release

All currently supported environments.

Instructions

To pass other fields from the discovery schedule, like discovery does with location OOB, would require to update the scripts mentioned. Note that such scripts would be owned by the team which customized it. A simpler option would be to pass fields to the CIs post discovery.

When a discovery for a device completes, a discovery.device.complete event is triggered. Script Actions process such events and take action. Therefore, another option would be to create a script action, "System Policy > Events > Script Actions", which would update such field accordingly when processing the discovery.device.complete.

In the following example, the script action dot walks to the schedule and collects the sys_updated_on field and logs it:

(function() { 
var updateOn = current.status.dscheduler.sys_updated_on + "";
gs.log("updateOn: " + updateOn, "updateOn");
}());

Related Links

For more information about script actions please see:

  • https://docs.servicenow.com/csh?topicname=r_ScriptActions.html&version=latest

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.