EN
Español
English
Português
    sys_choice

    SysChoice type values are added in the “sys_choice”, the entity asks for the following attributes to perform a registration:



    Mapping the class in the configuration file:

    {
      "searchBy": [
        "name",
        "value"
      ],
      "name": "sys_choice",
      "fields": [
        {
          "type": "string",
          "name": "element",
          "mappingType": "Data",
          "mappingName": null,
          "isRequired": true,
          "classReference": null
        },
        {
          "type": "string",
          "name": "name",
          "mappingType": "Data",
          "mappingName": null,
          "isRequired": true,
          "classReference": null
        },
        {
          "type": "string",
          "name": "value",
          "mappingType": "Mapper",
          "mappingName": null,
          "isRequired": false,
          "classReference": null
        },
        {
          "type": "string",
          "name": "label",
          "mappingType": "Mapper",
          "mappingName": null,
          "isRequired": false,
          "classReference": null
        }
      ]
    }
    

    To add these values to our settings, the “value” and “label” they are the only ones that are taken from the device; The other attributes are recorded in “dataReference”,

    {
      "dataReference": [
        {
          "name": "OperatingSystemReferenced",
          "fields": [
            {
              "value": "os",
              "fieldCMDB": "lement",
              "classDevice": [
                "Laptop",
                "Desktop"
              ]
            },
            {
              "value": "cmdb_ci_computer",
              "fieldCMDB": "name",
              "classDevice": [
                "Laptop",
                "Desktop"
              ]
            }
          ]
        }
      ],
      "mapper": [
        {
          "name": "OperatingSystemReferenced",
          "fields": [
            {
              "fieldDevice": "operatingSystem",
              "fieldCMDB": "os"
            },
            {
              "fieldDevice": "operatingSystem",
              "fieldCMDB": "label"
            }
          ]
        }
      ],
      "classCMDB": [
        {
          "searchBy": [
            "object_id"
          ],
          "name": "cmdb_ci_computer",
          "fields": [
            {
              "type": "string",
              "name": "os",
              "mappingType": "SysChoice",
              "mappingName": "OperatingSystemReferenced",
              "isRequired": false,
              "classReference": "sys_choice"
            }
          ]
        }
      ]
    }
    

    Where:

    “fieldCMDB”: “name”: the “name” attribute, refers to the class to which “sys_choice” will be related

    “fieldCMDB”: “element”: The “element” attribute will take the value of the field it refers to, because the referring field is “os” of the class “cmdb_ci_computer”, assign its value as “os”




    View Ci ↪ Class Mapping