The “cmdb_hardware_product_model” class relates the “cmdb_ci_computer” class to a model, this allows the IC to be part of the Assets

The properties that will take on a value are:
- Name
- short_description
- manufacturer
- cmdb_model_category: This property accepts array-type values, because a device can be part of different categories, as can be seen in the image.
In addition, this property refers to the class “cmdb_model_category”

In the configuration file, add the properties of this ServiceNow class
{
"searchBy": [
"name"
],
"name": "cmdb_hardware_product_model",
"fields": [
{
"type": "string",
"name": "manufacturer",
"mappingType": "Reference",
"mappingName": "CompanyManufactureReference",
"isRequired": false,
"classReference": "core_company"
},
{
"type": "array",
"name": "cmdb_model_category",
"mappingType": "Reference",
"mappingName": "HardwareCategoryReference",
"isRequired": false,
"classReference": "cmdb_model_category"
},
{
"type": "string",
"name": "name",
"mappingType": "Mapper",
"mappingName": null,
"isRequired": true,
"classReference": null
},
{
"type": "string",
"name": "short_description",
"mappingType": "Mapper",
"mappingName": null,
"isRequired": false,
"classReference": null
}
]
}
Add the class “cmdb_hardware_product_model” to the configuration file as follows:
This class is referred to by the “model_id” with a “mappingName” “HardwareProductModelReference”, which references the “dataReference” and “mapper” property of the configuration file, where you will place their respective values
{
"mapper": [
{
"name": "HardwareProductModelReference",
"fields": [
{
"fieldDevice": "model",
"fieldCMDB": "name"
},
{
"fieldDevice": "model",
"fieldCMDB": "short_description"
}
]
}
],
"dataReference": [
{
"name": "HardwareProductModelReference",
"fields": [
{
"fieldDevice": "model",
"fieldCMDB": "name"
},
{
"fieldDevice": "model",
"fieldCMDB": "short_description"
}
]
}
],
"classCMDB": [
{
"searchBy": [
"object_id"
],
"name": "cmdb_ci_computer",
"fields": [
{
"type": "string",
"name": "model_id",
"mappingType": "Reference",
"mappingName": "HardwareProductModelReference",
"isRequired": false,
"classReference": "cmdb_hardware_product_model"
}
]
},
{
"searchBy": [
"name"
],
"name": "cmdb_hardware_product_model",
"fields": [
{
"type": "string",
"name": "manufacturer",
"mappingType": "Reference",
"mappingName": "CompanyManufactureReference",
"isRequired": false,
"classReference": "core_company"
},
{
"type": "array",
"name": "cmdb_model_category",
"mappingType": "Reference",
"mappingName": "HardwareCategoryReference",
"isRequired": false,
"classReference": "cmdb_model_category"
},
{
"type": "string",
"name": "name",
"mappingType": "Mapper",
"mappingName": null,
"isRequired": true,
"classReference": null
},
{
"type": "string",
"name": "short_description",
"mappingType": "Mapper",
"mappingName": null,
"isRequired": false,
"classReference": null
}
]
}
]
}
This class has the following classes as a reference:
They are added in the “classCMDB” property of the configuration file and registered in the configuration for “mapper” and “dataReference”, of the classes I add:
{
"mapper": [
{
"name": "HardwareProductModelReference",
"fields": [
{
"fieldDevice": "model",
"fieldCMDB": "name"
},
{
"fieldDevice": "model",
"fieldCMDB": "short_description"
}
]
},
{
"name": "CompanyManufactureReference",
"fields": [
{
"fieldDevice": "manufacturer",
"fieldCMDB": "name"
}
]
}
],
"dataReference": [
{
"name": "HardwareProductModelReference",
"fields": [
{
"fieldDevice": "model",
"fieldCMDB": "name"
},
{
"fieldDevice": "model",
"fieldCMDB": "short_description"
}
]
},
{
"name": "CompanyManufactureReference",
"fields": [
{
"value": "false",
"fieldCMDB": "manufacturer",
"classDevice": [
"Laptop",
"Desktop"
]
},
{
"value": "false",
"fieldCMDB": "vendor",
"classDevice": [
"Laptop",
"Desktop"
]
}
]
}
],
"classCMDB": [
{
"searchBy": [
"object_id"
],
"name": "cmdb_ci_computer",
"fields": [
{
"type": "string",
"name": "model_id",
"mappingType": "Reference",
"mappingName": "HardwareProductModelReference",
"isRequired": false,
"classReference": "cmdb_hardware_product_model"
}
]
},
{
"searchBy": [
"name"
],
"name": "cmdb_hardware_product_model",
"fields": [
{
"type": "string",
"name": "manufacturer",
"mappingType": "Reference",
"mappingName": "CompanyManufactureReference",
"isRequired": false,
"classReference": "core_company"
},
{
"type": "array",
"name": "cmdb_model_category",
"mappingType": "Reference",
"mappingName": "HardwareCategoryReference",
"isRequired": false,
"classReference": "cmdb_model_category"
},
{
"type": "string",
"name": "name",
"mappingType": "Mapper",
"mappingName": null,
"isRequired": true,
"classReference": null
},
{
"type": "string",
"name": "short_description",
"mappingType": "Mapper",
"mappingName": null,
"isRequired": false,
"classReference": null
}
]
},
{
"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
}
]
},
{
"searchBy": [
"cmdb_ci_class"
],
"name": "cmdb_model_category",
"fields": [
{
"type": "string",
"name": "cmdb_ci_class",
"mappingType": "Data",
"mappingName": null,
"isRequired": true,
"classReference": null
}
]
}
]
}