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.
Issue inserting records with IRE and Normalization plugins - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • Issue inserting records with IRE and Normalization plugins
KB0856085

Issue inserting records with IRE and Normalization plugins


1040 Views Last updated : Apr 8, 2025 public Copy Permalink
KB Summary by Now Assist

Issue

When IRE and Normlization plugin are both enabled, the method createOrUpdateCI() always insert even when the item is already created.

Steps to Reproduce:
1. Activate the plugins:-
Enable plugin : Configuration Management For Scoped Apps (CMDB) (com.snc.cmdb.scoped).
Enable plugin: Field Normalization (com.snc.field_normalization).

2. Create a sys_choice.LIST
Table = cmdb_ci
Element = discovery_source
Label = Nexthink CMDB Connector
Value = nexthink_cmdb_connector
Save

3. New field in the CMDB_CI_Computer table to have a RAW value:-
Tables>> Search Name cmdb_ci_computer
Create New Table Columns in the computer table
Type = String
Column Label = Raw Name
Column Name = u_raw_name
max leangth = 255
Save.

4. Create Transformation:-
Go to Field Normalization - Transformation and create a New one:
Name: Computer name
Table: cmdb_ci_computer
Field: Name
Mode: Active
Normalize query: true
Raw field: raw_name

Create a transform inside the previous record:
Type: Suffix
Name: Add _nexthink
Suffix: _nexthink
Final: false

5. CI Class Manager - Identification Entries
Computer>> Remove all and create a new one to use only the Name(From Computer Table)

6. Now run the following Script in Scripts-Background

var ireApi = sn_cmdb.IdentificationEngine;

var payload = {"items":[{"className":"cmdb_ci_win_server","internal_id":"cmdb_ci_win_server_WIN-9G","values":{"sys_class_name":"cmdb_ci_win_server", "last_discovered":"2020-07-28 12:52:08","os_domain":"WORKGROUP","cpu_core_count":"2","cpu_count":"1","cpu_manufacturer":"7aad6d00c611228400f00e0f80b67d2d","cpu_speed":"2601","cpu_type":"Intel Core i7-5600U CPU","disk_space":237.87304306030273,"manufacturer":"59bab02c2f825410b99959a72799b622","model_id":"b4b1cc132f351010b88959a72799b61e","os":"Windows 2019 Server Standard 1809","os_service_pack":"","os_version":"","serial_number":"38XXX2","ram":16384,"name":"WIN-9G"}}]};

var payloadString = JSON.stringify(payload);

var identifiOutput = ireApi.identifyCI(payloadString);
gs.info(JSON.stringify(identifiOutput));
ireApi.createOrUpdateCI("nexthink_cmdb_connector" ,payloadString );
var identifiOutput = ireApi.identifyCI(payloadString);
gs.info(JSON.stringify(identifiOutput));
ireApi.createOrUpdateCI("nexthink_cmdb_connector" ,payloadString);

The above steps to reproduce creates two records in the cmdb_ci_win_server table.

Release

All Release.

Cause

The main reason for this issue is because the only identifier being used here in this case is "Name" but at the same time field transformation is also being used to change the 'Name' (by adding a suffix).

Resolution

The createOrUpdateCI() is being called twice in the script for the same payload. Only 'name' is being used to uniquely identify a CI (CI identifier) but field transformation is also being used to change the 'Name' (by adding a suffix).

Explanation:
1. On first run IRE inserts CI with name 'WIN-9G' (because a CI with that name does not exist in the CMDB).
2. Transform engine kicks in after the CI is inserted in DB and changes the name to WIN-9G_nexthink (this can be seen from audit history set)
3. On second run IRE cannot find a CI with name 'WIN-9G' (because transform has already changed the name of the CI to WIN-9G_nexthink), so inserts a new CI.

To resolve,
1. Do not change the name of the CI or ensure that the payload contains the updated CI name.
Or
2. Use another identifier entry like serial_number to uniquely identify the CI.

From above we can see that it is actually working as expected and thus is not a product defect.


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?

Attachments

Attachments

No attachments found

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.