Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

New Hardware Asset creates a CI in operational status of Operational instead of Received.

Bobby Campbell
Kilo Sage

I imported 35 new UPS assets into alm_hardware.  The corresponding UPS CIs were all created with Operational Status = Operational.  The desired Operational Status is Received.

 

When I performed this task six months ago, the UPS CIs were created with the correct Operational Status of Received.  I don't know what changed, nor how to ensure that subsequent imports will reflect the correct Operational Status.

 

The import spreadsheet contains these fields:

  • Model Category
  • Serial Number
  • Stockroom
  • Owned By
  • Location
  • Manufacturer
  • Model
1 ACCEPTED SOLUTION

G Ponsekar
Tera Guru

Hi @Bobby Campbell .

 

The change in the default Operational Status from "Received" to "Operational" is likely caused by a modification in an out-of-the-box ServiceNow Business Rule or a change in the CI Class Manager settings. The platform synchronizes the asset's state/substate with the CI's status fields. The synchronization logic is typically controlled by the "Sync Ops Status for CMDB CI" business rule on the cmdb_ci table

 

You have two primary options to ensure the correct "Received" status for future imports:

Option A: Include "Operational Status" in Your Import Spreadsheet (Recommended)
The simplest and most direct method is to add an Operational Status column to your import spreadsheet and explicitly map it to the operational_status field during the transform map process. This overrides any default system logic.
  • Add Column: Add a column named "Operational Status" (or something similar) to your spreadsheet.
  • Set Value: Enter Received (or the corresponding numerical value, typically 1 or 2 depending on your instance's configuration) for all assets.
  • Map Field: During your import process's Transform Map, ensure you map this new column from your import set table to the operational_status field on the alm_hardware (or related CMDB CI) table.
 
Option B: Modify the Transform Map Script
If you cannot modify the import spreadsheet, you can add an onBefore transform script to set the operational status for all new records being processed by that specific import.
  1. Navigate to System Import Sets > Transform Maps.
  2. Open the Transform Map used for this UPS import.
  3. Go to the Transform Scripts related list and click New.
  4. Set the When field to onBefore.
  5. In the Script field, add the following code:
    javascript
    // Set the operational status to 'Received'
    target.operational_status = 2;

 

 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

 

Thanks, GP

View solution in original post

1 REPLY 1

G Ponsekar
Tera Guru

Hi @Bobby Campbell .

 

The change in the default Operational Status from "Received" to "Operational" is likely caused by a modification in an out-of-the-box ServiceNow Business Rule or a change in the CI Class Manager settings. The platform synchronizes the asset's state/substate with the CI's status fields. The synchronization logic is typically controlled by the "Sync Ops Status for CMDB CI" business rule on the cmdb_ci table

 

You have two primary options to ensure the correct "Received" status for future imports:

Option A: Include "Operational Status" in Your Import Spreadsheet (Recommended)
The simplest and most direct method is to add an Operational Status column to your import spreadsheet and explicitly map it to the operational_status field during the transform map process. This overrides any default system logic.
  • Add Column: Add a column named "Operational Status" (or something similar) to your spreadsheet.
  • Set Value: Enter Received (or the corresponding numerical value, typically 1 or 2 depending on your instance's configuration) for all assets.
  • Map Field: During your import process's Transform Map, ensure you map this new column from your import set table to the operational_status field on the alm_hardware (or related CMDB CI) table.
 
Option B: Modify the Transform Map Script
If you cannot modify the import spreadsheet, you can add an onBefore transform script to set the operational status for all new records being processed by that specific import.
  1. Navigate to System Import Sets > Transform Maps.
  2. Open the Transform Map used for this UPS import.
  3. Go to the Transform Scripts related list and click New.
  4. Set the When field to onBefore.
  5. In the Script field, add the following code:
    javascript
    // Set the operational status to 'Received'
    target.operational_status = 2;

 

 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

 

Thanks, GP