EN
Español
English
Português
    core_company

    The “core_company” class is required by different ServiceNow classes, in the configuration file where it is referenced use the “mappingName” to designate how it will obtain its values according to the field that refers to this class. The attributes that are taken into account are the following:

    • Name
    • Manufacturer
    • Vendor



    The attributes of the “core_company” class mapped to the configuration file take this form:

    {
      "searchBy": [
        "name"
      ],
      "name": "core_company",
      "fields": [
        {
          "type": "string",
          "name": "name",
          "mappingType": "Mapper",
          "mappingName": null,
          "isRequired": true,
          "classReference": null
        },
        {
          "type": "boolean",
          "name": "manufacturer",
          "mappingType": "Data",
          "mappingName": null,
          "isRequired": false,
          "classReference": null
        },
        {
          "type": "boolean",
          "name": "vendor",
          "mappingType": "Data",
          "mappingName": null,
          "isRequired": false,
          "classReference": null
        }
      ]
    }
    

    It is important to note that this class has properties of “mappingType” = “Data”, this type of value will be recorded in the “dataReference” in the configuration file.

    Write the class in the configuration file with the class that references it, in this class “cmdb_ci_computer”

    {
      "dataReference": [
    
      ],
      "mapper": [
    
      ],
      "classCMDB": [
        {
          "searchBy": [
            "object_id"
          ],
          "name": "cmdb_ci_computer",
          "fields": [
            {
              "type": "string",
              "name": "manufacturer",
              "mappingType": "Reference",
              "mappingName": "CompanyManufactureReference",
              "isRequired": false,
              "classReference": "core_company"
            },
            {
              "type": "string",
              "name": "company",
              "mappingType": "Reference",
              "mappingName": "CompanyOwnerReference",
              "isRequired": false,
              "classReference": "core_company"
            }
          ]
        },
        {
          "searchBy": [
            "name"
          ],
          "name": "core_company",
          "fields": [
            {
              "type": "string",
              "name": "name",
              "mappingType": "Mapper",
              "mappingName": null,
              "isRequired": true,
              "classReference": null
            },
            {
              "type": "boolean",
              "name": "manufacturer",
              "mappingType": "Data",
              "mappingName": null,
              "isRequired": false,
              "classReference": null
            },
            {
              "type": "boolean",
              "name": "vendor",
              "mappingType": "Data",
              "mappingName": null,
              "isRequired": false,
              "classReference": null
            }
          ]
        }
      ]
    }
    

    The class “core_company” is referenced twice. This does not imply duplicating the class in the property “classCMDB”, is only added once using the “mappingName” which references “dataReference” and “mapper” to get the values as follows:

    • CompanyManufactureReference
    • CompanyOwnerReference
    {
      "dataReference": [
      ],
      "mapper": [
      ],
      "classCMDB": [
        {
          "searchBy": [
            "object_id"
          ],
          "name": "cmdb_ci_computer",
          "fields": [
            {
              "type": "string",
              "name": "manufacturer",
              "mappingType": "Reference",
              "mappingName": "CompanyManufactureReference",
              "isRequired": false,
              "classReference": "core_company"
            },
            {
              "type": "string",
              "name": "company",
              "mappingType": "Reference",
              "mappingName": "CompanyOwnerReference",
              "isRequired": false,
              "classReference": "core_company"
            }
          ]
        }
      ]
    }
    

    To resolve the value of the “mappingName”: “CompanyOwnerReference” will be created statically for all devices related to the “cmdb_ci_computer”; The value that the attribute will take is recorded “fieldCMDB”: “name” of the “core_company” class in “dataReference” as follows:

    {
      "dataReference": [
        {
          "name": "CompanyOwnerReference",
          "fields": [
            {
              "value": "Aranda Software",
              "fieldCMDB": "name",
              "classDevice": [
                "Desktop"
              ]
            },
            {
              "value": "false",
              "fieldCMDB": "manufacturer",
              "classDevice": [
                "Desktop"
              ]
            },
            {
              "value": "false",
              "fieldCMDB": "vendor",
              "classDevice": [
                "Desktop"
              ]
            }
          ]
        }
      ],
      "mapper": [
    
      ],
      "classCMDB": [
    
      ]
    }
    

    It is added in this way because the Aranda DEVIDCE MANAGEMENT ADM APIs do not bring the owner’s company information.

    Putting all the settings together:

    {
      "dataReference": [
        {
          "name": "CompanyManufactureReference",
          "fields": [
            {
              "value": "false",
              "fieldCMDB": "manufacturer",
              "classDevice": [
                "Desktop"
    
              ]
            },
            {
              "value": "false",
              "fieldCMDB": "vendor",
              "classDevice": [
                "Desktop"
              ]
            }
          ]
        },
        {
          "name": "CompanyOwnerReference",
          "fields": [
            {
              "value": "Aranda Software",
              "fieldCMDB": "name",
              "classDevice": [
                "Desktop"
              ]
            },
            {
              "value": "false",
              "fieldCMDB": "manufacturer",
              "classDevice": [
                "Desktop"
              ]
            },
            {
              "value": "false",
              "fieldCMDB": "vendor",
              "classDevice": [
                "Desktop"
              ]
            }
          ]
        }
      ],
      "mapper": [
        {
          "name": "CompanyManufactureReference",
          "fields": [
            {
              "fieldDevice": "manufacturer",
              "fieldCMDB": "name"
            }
          ]
        }
      ],
      "classCMDB": [
        {
          "searchBy": [
            "object_id"
          ],
          "name": "cmdb_ci_computer",
          "fields": [
            {
              "type": "string",
              "name": "manufacturer",
              "mappingType": "Reference",
              "mappingName": "CompanyManufactureReference",
              "isRequired": false,
              "classReference": "core_company"
            },
            {
              "type": "string",
              "name": "company",
              "mappingType": "Reference",
              "mappingName": "CompanyOwnerReference",
              "isRequired": false,
              "classReference": "core_company"
            }
          ]
        },
        {
          "searchBy": [
            "name"
          ],
          "name": "core_company",
          "fields": [
            {
              "type": "string",
              "name": "name",
              "mappingType": "Mapper",
              "mappingName": null,
              "isRequired": true,
              "classReference": null
            },
            {
              "type": "boolean",
              "name": "manufacturer",
              "mappingType": "Data",
              "mappingName": null,
              "isRequired": false,
              "classReference": null
            },
            {
              "type": "boolean",
              "name": "vendor",
              "mappingType": "Data",
              "mappingName": null,
              "isRequired": false,
              "classReference": null
            }
          ]
        }
      ]
    }
    


    View Ci ↪ Class Mapping