Restricting assets that can be used as replacements

Jason Nichols
ServiceNow Employee
ServiceNow Employee

In the Hardware Asset Management Fundamentals course, a common question that arises is how can the list of assets available for replacement be set with a default filter? We're talking here about the "Swapped CI" feature. By default, only hardware CIs that have a corresponding asset record are available for selection. But how can we restrict the list further, to show only assets from a certain location/stockroom, or to match the class of the asset being replaced? We need to change the default filter/reference qualifier of the Swapped CI field:

  1. Open the Swapped CI (swapped_ci) record in the sys_dictionary table.
  2. Switch to the Advanced form view.
  3. Add further conditions to the reference qualifier, as necessary. For example, you could use the following advanced reference qualifier to display CIs of the same class that are currently in stock and available: 
    javascript:"sys_class_name=" + current.ci_item.sys_class_name + "^asset.install_status=6^asset.substatus=available"

swapped_ci.png

You could expand this reference qualifier based on model, or include some logic to display only assets from a certain location. In this case I would recommend saving the reference qualifier as a script include and referencing it from the dictionary record.

 

See also:

  • Reference qualifiers (ServiceNow Docs)
  • The TransferOrderLineFilters baseline script include contains some functions used by reference qualifiers that may be helpful to understand the concept of using script includes as reference qualifiers.

Has anyone implemented this requirement using something similar, or different? If so, please share, as this requirement seems to be a common one.

1 REPLY 1

Daniel Bruton
Tera Contributor

@Jason NicholsThank you for this information. It adds significant value to our users' experience by eliminating the need to search through all configuration items to find what's available in the stockrooms.