<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Trouble with the IdentificationEngine API (createOrUpdateCI()) in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/trouble-with-the-identificationengine-api-createorupdateci/m-p/2520672#M981950</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am trying to use this API resource to create some CIs through a scripted REST endpoint, but there are two issues.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;When I send CI properties for a firewall and one of its interfaces, both CIs are created, but the manufacturer field of the firewall is blank. ServiceNow responds (&lt;SPAN&gt;I also tried sending the sys_id of the "Cisco" entry from the core_company table)&lt;/SPAN&gt;:&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"info": [
                    {
                        "code": "SKIPPED_SETTING_REFERENCE_FIELD",
                        "message": "Table does not have a display value column: [core_company]. Skipped setting the reference field: [class: cmdb_ci_ip_firewall] [field: manufacturer] [value: Cisco]"
                    }
                ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The JSON looks like this:&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
    {
        "items": [
            {
                "className": "cmdb_ci_ip_firewall",
                "values": {
                    "os_name": "Cisco Adaptive Security Appliance Version 9.8(4)29",
                    "host_name": "asa01",
                    "ip_address": "10.0.0.1",
                    "name": "asa01"
                },
                "display_values": {
                    "manufacturer": "b7e831bdc0a80169015ae101f3c4d6cd"
                },
                "internal_id": "314",
                "sys_object_source_info": {
                    "source_recency_timestamp": "3/26/2023 2:35:17 PM",
                    "source_name": "My custom source"
                }
            },
            {
                "className": "cmdb_ci_ni_interface",
                "values": {
                    "name": "id[06]",
                    "short_description": "Discovered by agent 20 via NSP collector",
                    "serial_number": "123456"
                },
                "internal_id": "18705013",
                "sys_object_source_info": {
                    "source_recency_timestamp": "3/26/2023 2:35:17 PM",
                    "source_name": "My custom source"
                }
            }
        ]
    }
]​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Using that same JSON, but adding a relationship, I get back:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"errors": [
                {
                    "error": "INVALID_INPUT_DATA",
                    "message": "Payload relations '{\"parent\":314,\"child\":18705013,\"type\":\"Owns::Owned by\",\"sys_rel_source_info\":{\"source_recency_timestamp\":\"3/26/2023 2:35:17 PM\",\"source_name\":\"My custom source\"}}' has invalid parent record index: [314]"
                },
                {
                    "error": "INVALID_INPUT_DATA",
                    "message": "Payload relations '{\"parent\":314,\"child\":18705013,\"type\":\"Owns::Owned by\",\"sys_rel_source_info\":{\"source_recency_timestamp\":\"3/26/2023 2:35:17 PM\",\"source_name\":\"My custom source\"}}' has invalid child record index: [18705013]"
                }
            ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;With the relations node, the JSON looks like this:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
    {
        "items": [
            {
                "className": "cmdb_ci_ip_firewall",
                "values": {
                    "os_name": "Cisco Adaptive Security Appliance Version 9.8(4)29",
                    "host_name": "asa01",
                    "ip_address": "10.0.0.1",
                    "name": "asa01"
                },
                "display_values": {
                    "manufacturer": "b7e831bdc0a80169015ae101f3c4d6cd"
                },
                "internal_id": "314",
                "sys_object_source_info": {
                    "source_recency_timestamp": "3/26/2023 2:35:17 PM",
                    "source_name": "My custom source"
                }
            },
            {
                "className": "cmdb_ci_ni_interface",
                "values": {
                    "name": "id[06]",
                    "short_description": "Discovered by agent 20 via NSP collector",
                    "serial_number": "123456"
                },
                "internal_id": "18705013",
                "sys_object_source_info": {
                    "source_recency_timestamp": "3/26/2023 2:35:17 PM",
                    "source_name": "My custom source"
                }
            }
        ],
        "relations": [
            {
                "parent": "314",
                "type": "Owns::Owned by",
                "sys_rel_source_info": {
                    "source_recency_timestamp": "3/26/2023 2:35:17 PM",
                    "source_name": "My custom source"
                },
                "child": "18705013"
            }
        ]
    }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone provide insight into these issues? How should I be pass the manufacturer reference field value and what is wrong with the parent and child identifiers in my relationship? Where should those values come from?&lt;/P&gt;</description>
    <pubDate>Wed, 29 Mar 2023 16:56:01 GMT</pubDate>
    <dc:creator>mhashemi</dc:creator>
    <dc:date>2023-03-29T16:56:01Z</dc:date>
    <item>
      <title>Trouble with the IdentificationEngine API (createOrUpdateCI())</title>
      <link>https://www.servicenow.com/community/developer-forum/trouble-with-the-identificationengine-api-createorupdateci/m-p/2520672#M981950</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am trying to use this API resource to create some CIs through a scripted REST endpoint, but there are two issues.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;When I send CI properties for a firewall and one of its interfaces, both CIs are created, but the manufacturer field of the firewall is blank. ServiceNow responds (&lt;SPAN&gt;I also tried sending the sys_id of the "Cisco" entry from the core_company table)&lt;/SPAN&gt;:&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"info": [
                    {
                        "code": "SKIPPED_SETTING_REFERENCE_FIELD",
                        "message": "Table does not have a display value column: [core_company]. Skipped setting the reference field: [class: cmdb_ci_ip_firewall] [field: manufacturer] [value: Cisco]"
                    }
                ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The JSON looks like this:&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
    {
        "items": [
            {
                "className": "cmdb_ci_ip_firewall",
                "values": {
                    "os_name": "Cisco Adaptive Security Appliance Version 9.8(4)29",
                    "host_name": "asa01",
                    "ip_address": "10.0.0.1",
                    "name": "asa01"
                },
                "display_values": {
                    "manufacturer": "b7e831bdc0a80169015ae101f3c4d6cd"
                },
                "internal_id": "314",
                "sys_object_source_info": {
                    "source_recency_timestamp": "3/26/2023 2:35:17 PM",
                    "source_name": "My custom source"
                }
            },
            {
                "className": "cmdb_ci_ni_interface",
                "values": {
                    "name": "id[06]",
                    "short_description": "Discovered by agent 20 via NSP collector",
                    "serial_number": "123456"
                },
                "internal_id": "18705013",
                "sys_object_source_info": {
                    "source_recency_timestamp": "3/26/2023 2:35:17 PM",
                    "source_name": "My custom source"
                }
            }
        ]
    }
]​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Using that same JSON, but adding a relationship, I get back:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;"errors": [
                {
                    "error": "INVALID_INPUT_DATA",
                    "message": "Payload relations '{\"parent\":314,\"child\":18705013,\"type\":\"Owns::Owned by\",\"sys_rel_source_info\":{\"source_recency_timestamp\":\"3/26/2023 2:35:17 PM\",\"source_name\":\"My custom source\"}}' has invalid parent record index: [314]"
                },
                {
                    "error": "INVALID_INPUT_DATA",
                    "message": "Payload relations '{\"parent\":314,\"child\":18705013,\"type\":\"Owns::Owned by\",\"sys_rel_source_info\":{\"source_recency_timestamp\":\"3/26/2023 2:35:17 PM\",\"source_name\":\"My custom source\"}}' has invalid child record index: [18705013]"
                }
            ]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;With the relations node, the JSON looks like this:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[
    {
        "items": [
            {
                "className": "cmdb_ci_ip_firewall",
                "values": {
                    "os_name": "Cisco Adaptive Security Appliance Version 9.8(4)29",
                    "host_name": "asa01",
                    "ip_address": "10.0.0.1",
                    "name": "asa01"
                },
                "display_values": {
                    "manufacturer": "b7e831bdc0a80169015ae101f3c4d6cd"
                },
                "internal_id": "314",
                "sys_object_source_info": {
                    "source_recency_timestamp": "3/26/2023 2:35:17 PM",
                    "source_name": "My custom source"
                }
            },
            {
                "className": "cmdb_ci_ni_interface",
                "values": {
                    "name": "id[06]",
                    "short_description": "Discovered by agent 20 via NSP collector",
                    "serial_number": "123456"
                },
                "internal_id": "18705013",
                "sys_object_source_info": {
                    "source_recency_timestamp": "3/26/2023 2:35:17 PM",
                    "source_name": "My custom source"
                }
            }
        ],
        "relations": [
            {
                "parent": "314",
                "type": "Owns::Owned by",
                "sys_rel_source_info": {
                    "source_recency_timestamp": "3/26/2023 2:35:17 PM",
                    "source_name": "My custom source"
                },
                "child": "18705013"
            }
        ]
    }
]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone provide insight into these issues? How should I be pass the manufacturer reference field value and what is wrong with the parent and child identifiers in my relationship? Where should those values come from?&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 16:56:01 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/trouble-with-the-identificationengine-api-createorupdateci/m-p/2520672#M981950</guid>
      <dc:creator>mhashemi</dc:creator>
      <dc:date>2023-03-29T16:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble with the IdentificationEngine API (createOrUpdateCI())</title>
      <link>https://www.servicenow.com/community/developer-forum/trouble-with-the-identificationengine-api-createorupdateci/m-p/2645913#M1027277</link>
      <description>&lt;P&gt;When using the "internal_id" fields&amp;nbsp; you need switch out your "parent" and "child" in relations with "parent_id" and "child_id".&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var payload = {
        "items": [
            {
                "className": "cmdb_ci_ip_firewall",
                "values": {
                    "os_name": "Cisco Adaptive Security Appliance Version 9.8(4)29",
                    "host_name": "asa01",
                    "ip_address": "10.0.0.1",
                    "name": "asa01"
                },
                "display_values": {
                    "manufacturer": "b7e831bdc0a80169015ae101f3c4d6cd"
                },
                "internal_id": "314",
                "sys_object_source_info": {
                    "source_recency_timestamp": "3/26/2023 2:35:17 PM",
                    "source_name": "My custom source"
                }
            },
            {
                "className": "cmdb_ci_ni_interface",
                "values": {
                    "name": "id[06]",
                    "short_description": "Discovered by agent 20 via NSP collector",
                    "serial_number": "123456"
                },
                "internal_id": "18705013",
                "sys_object_source_info": {
                    "source_recency_timestamp": "3/26/2023 2:35:17 PM",
                    "source_name": "My custom source"
                }
            }
        ],
        "relations": [
            {
                "parent_id": "314",
                "type": "Owns::Owned by",
                "sys_rel_source_info": {
                    "source_recency_timestamp": "3/26/2023 2:35:17 PM",
                    "source_name": "My custom source"
                },
                "child_id": "18705013"
            }
        ]
    };

var input = JSON.stringify((payload));
var output = sn_cmdb.IdentificationEngine.identifyCIEnhanced('Other Automated', input, {});

gs.info(JSON.stringify(JSON.parse(output), null, 2));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp; The "parent" and "child" are looking for Items order.&amp;nbsp; See following example.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var payload = {
        "items": [
            {
                "className": "cmdb_ci_ip_firewall",
                "values": {
                    "os_name": "Cisco Adaptive Security Appliance Version 9.8(4)29",
                    "host_name": "asa01",
                    "ip_address": "10.0.0.1",
                    "name": "asa01"
                },
                "display_values": {
                    "manufacturer": "b7e831bdc0a80169015ae101f3c4d6cd"
                },
                "internal_id": "314",
                "sys_object_source_info": {
                    "source_recency_timestamp": "3/26/2023 2:35:17 PM",
                    "source_name": "My custom source"
                }
            },
            {
                "className": "cmdb_ci_ni_interface",
                "values": {
                    "name": "id[06]",
                    "short_description": "Discovered by agent 20 via NSP collector",
                    "serial_number": "123456"
                },
                "internal_id": "18705013",
                "sys_object_source_info": {
                    "source_recency_timestamp": "3/26/2023 2:35:17 PM",
                    "source_name": "My custom source"
                }
            }
        ],
        "relations": [
            {
                "parent": "0",
                "type": "Owns::Owned by",
                "sys_rel_source_info": {
                    "source_recency_timestamp": "3/26/2023 2:35:17 PM",
                    "source_name": "My custom source"
                },
                "child": "1"
            }
        ]
    };

var input = JSON.stringify((payload));
var output = sn_cmdb.IdentificationEngine.identifyCIEnhanced('Other Automated', input, {});

gs.info(JSON.stringify(JSON.parse(output), null, 2));&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2023 16:12:17 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/trouble-with-the-identificationengine-api-createorupdateci/m-p/2645913#M1027277</guid>
      <dc:creator>petermueller</dc:creator>
      <dc:date>2023-08-17T16:12:17Z</dc:date>
    </item>
  </channel>
</rss>

