<?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 Re: Dependent classes not working. CMDB Instance API; POST https://.service-now.com/api/now/cmdb/ins in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/dependent-classes-not-working-cmdb-instance-api-post-https/m-p/2365413#M925814</link>
    <description>&lt;P&gt;The accepted solution in this post worked for me (add "depends_on" to the "inbound_relations")&lt;BR /&gt;&lt;A href="https://www.servicenow.com/community/developer-forum/can-t-insert-cmdb-ci-storage-volume-ci-via-cmdb-instance-api/m-p/2247303" target="_blank"&gt;https://www.servicenow.com/community/developer-forum/can-t-insert-cmdb-ci-storage-volume-ci-via-cmdb-instance-api/m-p/2247303&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "attributes": {
        "sys_class_name": "cmdb_ci_kubernetes_namespace",
        "name": "test-namespace-ci",
        "k8s_uid": "test-namespace-ci"
    },
    "source": "ServiceNow",
    "depends_on": {
        "inbound_relations": {
            "type": "55c95bf6c0a8010e0118ec7056ebc54d",
            "target": "3afa3dfe47e2595042d38e88436d43c1"
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Oct 2022 21:12:25 GMT</pubDate>
    <dc:creator>Madison2</dc:creator>
    <dc:date>2022-10-27T21:12:25Z</dc:date>
    <item>
      <title>Dependent classes not working. CMDB Instance API; POST https://.service-now.com/api/now/cmdb/instance/ Create a record with associated relations;</title>
      <link>https://www.servicenow.com/community/developer-forum/dependent-classes-not-working-cmdb-instance-api-post-https/m-p/1842160#M499086</link>
      <description>&lt;P&gt;The CMDB Instance API POST https://.service-now.com/api/now/cmdb/instance/ Create a record with associated relation endpoint works for classes that have no dependency. However I get this error when the class has a dependency and I can not figure out how to represent the dependency in the payload.&lt;BR /&gt;&lt;BR /&gt;Endpoint:&lt;BR /&gt;/api/now/cmdb/instance/cmdb_ci_db_mssql_instance&lt;BR /&gt;&lt;BR /&gt;Payload:&lt;BR /&gt;{&lt;BR /&gt;   "outbound_relations":[],&lt;BR /&gt;   "attributes":{&lt;BR /&gt;      "name":"CI Test1",&lt;BR /&gt;      "short_description":"The CMDB Instance API test of endpoint, Create a record with associated relations."&lt;BR /&gt;   },&lt;BR /&gt;   "source":"ServiceNow",&lt;BR /&gt;   "inbound_relations":[]&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Response:&lt;BR /&gt;{"result":{"items":[{"className":"cmdb_ci_db_mssql_instance","sysId":"Unknown","identifierEntrySysId":"Unknown","errors":[{"error":"MISSING_DEPENDENCY","message":"In payload no relations defined for dependent class [cmdb_ci_db_mssql_instance] that matches any containment/hosting rules: [cmdb_ci_appl &amp;gt;&amp;gt; Runs on &amp;gt;&amp;gt; cmdb_ci_hardware]. Add appropriate relations in payload for '{\"className\":\"cmdb_ci_db_mssql_instance\",\"values\":{\"short_description\":\"The CMDB Instance API test of endpoint, Create a record with associated relations.\",\"name\":\"CI Test1\",\"sys_class_name\":\"cmdb_ci_db_mssql_instance\"},\"internal_id\":\"d698984ca575115088d34112f2309fd6\",\"sys_object_source_info\":{},\"settings\":{},\"sys_ire_info\":{},\"display_values\":{}}'"},{"error":"ABANDONED","message":"Too many other errors"}],"identificationAttempts":[{"info":"sys_object_source SKIPPED","attemptResult":"SKIPPED","identifierName":"","attributes":["source_name","source_native_key"],"searchOnTable":"sys_object_source","hybridEntryCiAttributes":[]}],"info":[],"errorCount":2,"inputIndices":[0],"mergedPayloadIds":[],"markers":[],"warningCount":0}],"additionalCommittedItems":[],"relations":[],"additionalCommittedRelations":[],"hasError":true,"hasWarning":false,"logContextId":"da98984c97751150cdea75600153afd6"}}&lt;BR /&gt;&lt;BR /&gt;For inbound/outbound relations I have tried combinations of &lt;BR /&gt;target: &lt;SYSID of="" cmdb_ci_db_mssql_instance="" class=""&gt;&lt;BR /&gt;type: &lt;SYSID of="" runs="" on=""&gt;&lt;BR /&gt;&lt;BR /&gt;I do NOT know how to represent the missing dependency mentioned in the error response.&lt;/SYSID&gt;&lt;/SYSID&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 19:05:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/dependent-classes-not-working-cmdb-instance-api-post-https/m-p/1842160#M499086</guid>
      <dc:creator>pFog</dc:creator>
      <dc:date>2022-09-02T19:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Dependent classes not working. CMDB Instance API; POST https://.service-now.com/api/now/cmdb/ins</title>
      <link>https://www.servicenow.com/community/developer-forum/dependent-classes-not-working-cmdb-instance-api-post-https/m-p/2365413#M925814</link>
      <description>&lt;P&gt;The accepted solution in this post worked for me (add "depends_on" to the "inbound_relations")&lt;BR /&gt;&lt;A href="https://www.servicenow.com/community/developer-forum/can-t-insert-cmdb-ci-storage-volume-ci-via-cmdb-instance-api/m-p/2247303" target="_blank"&gt;https://www.servicenow.com/community/developer-forum/can-t-insert-cmdb-ci-storage-volume-ci-via-cmdb-instance-api/m-p/2247303&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
    "attributes": {
        "sys_class_name": "cmdb_ci_kubernetes_namespace",
        "name": "test-namespace-ci",
        "k8s_uid": "test-namespace-ci"
    },
    "source": "ServiceNow",
    "depends_on": {
        "inbound_relations": {
            "type": "55c95bf6c0a8010e0118ec7056ebc54d",
            "target": "3afa3dfe47e2595042d38e88436d43c1"
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 21:12:25 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/dependent-classes-not-working-cmdb-instance-api-post-https/m-p/2365413#M925814</guid>
      <dc:creator>Madison2</dc:creator>
      <dc:date>2022-10-27T21:12:25Z</dc:date>
    </item>
  </channel>
</rss>

