EN
Español
English
Português
    Register the "model" property

    The property “model” relates the States and Additional AFLS Fields, the configuration file has the following JSON for model:

    {
        "model": [
            {
                "reference": "",
                "services": [
                    0
                ],
                "state": {
                    "key": "",
                    "mapping": [
                        {
                            "value": "",
                            "id": 0
                        }
                    ]
                },
                "additionalFields": [
                    {
                        "id": 0,
                        "field": {
                            "key": "",
                            "searchBy": ""
                        },
                        "mapping": [
                            {
                                "id": 0,
                                "value": ""
                            }
                        ],
                        "value": {
                            "id": 0,
                            "value": ""
                        }
                    }
                ]
            }
        ],
        "workOrder": [],
        "client": [],
        "company": [],
        "priority": [],
        "service": []
    }
    

    In previous sections, relationships were created between AFLS and ServiceNow properties

    AFLS Ownership Ownership in ServiceNow
    subject short_description
    Description Description
    service N/A
    priority priority
    client Caller
    Company Company
    state state
    Location Location
    Note work_notes

    1. With the help of a Aranda Field Service (AFLS) get the IDs of the services to be integrated, The services must be related to the same model.

    **Servicio:** 15 - Mantenimiento preventivo
    

    2. Type the values in the “model.services” from the configuration file:

    {
        "model": [
            {
                "reference": "",
                "services": [15],
                "state": {},
                "additionalFields": []
            }
        ]
    }
    

    3. Get the State property name in ServiceNow and type its name into the property “model.state.key” In the configuration file: “state”

    {
        "model": [
            {
                "state": {
                    "key": "state",
                    "mapping": [
                    ]
                },
                "services": [
                    15
                ],
                "additionalFields": []
            }
        ]
    }
    

    4. In Aranda Field Service (AFLS) It is managed in 5 states:

    * Open
    * Process
    * StandBy
    * Executed
    * Cancel
    
    A cada uno de los estados se asocian **Sub-Estados**, que permiten una transición entre los estados, para la integración es necesario relacionar los sub-estados con los estados de ServiceNow. Con ayuda de un administrador de **AFLS** obtenga los IDs de los ***Sub-Estados***.
    
    AFLS Sub-State ID
    New 187
    In Progress 188
    On Hold 189
    Resolved 190
    Closed 191

    5. Get the values for the property State by ServiceNow.

    State ServiceNow VALUE SERVICENOW
    New 1
    In Progress 2
    On Hold 3
    Resolved 5
    Closed 6

    6. The Sub-States of AFLS relates to ownership State by ServiceNow. Establish an equivalence between the values for the States as follows:

    State ServiceNow AFLS Record Type ID AFLS Record Type VALUE Channel SERVICENOW
    New New 187 1
    In Progress In Progress 188 2
    On Hold On Hold 189 3
    Resolved Resolved 190 5
    Closed Closed 191 6

    7. Type the values in the “model.state” from the configuration file:

    {
        "model": [
            {
                "state": {
                    "key": "state",
                    "mapping": [
                        {
                            "value": "1",
                            "id": 187
                        },
                        {
                            "value": "2",
                            "id": 188
                        },
                        {
                            "value": "3",
                            "id": 189
                        },
                        {
                            "value": "5",
                            "id": 190
                        },
                        {
                            "value": "6",
                            "id": 191
                        }
                    ]
                },
                "services": [
                    15
                ],
                "additionalFields": []
            }
        ]
    }
    

    Creating additional fields is allowed in AFLS and ServiceNow, if you want to include some of them in the integration follow the instructions below.

    1. We recommend that you create a table with the fields you want to add in the integration as follows:

    field in ServiceNow field in AFLS Id field SERVICENOW AFLS field id
    numeric field numeric field u_campo_num 286
    Short text Short text u_texto_corto 287
    towns towns u_glide_list 288
    Configuration Item Configuration Item u_reference_12 298

    13. Type the relationship in the configuration file

    {
        "model": [
            {
                "state": {
                    "key": "state",
                    "mapping": [
                        {
                            "value": "1",
                            "id": 187
                        },
                        {
                            "value": "2",
                            "id": 188
                        },
                        {
                            "value": "3",
                            "id": 189
                        },
                        {
                            "value": "5",
                            "id": 190
                        },
                        {
                            "value": "6",
                            "id": 191
                        }
                    ]
                },
                "services": [
                    15
                ],
                "additionalFields": [
                    {
                        "id": 286,
                        "value": "un valor que quiero que sea constante",
                        "field": {
                            "key": "u_campo_num"
                        }
                    },
                    {
                        "id": 287,
                        "field": {
                            "key": "u_texto_corto"
                        }
                    },
                    {
                        "id": 288,
                        "field": {
                            "key": "u_glide_list"
                        }
                    },
                    {
                        "id": 298,
                        "field": {
                            "key": "u_reference_12"
                        }
                    }
                ]
            }
        ]
    }
    

    Note that for the type fields Reference property is required searchBy which indicates the property by which the ServiceNow table will be searched.

    • The countryside u_reference_12 is a field of type reference to the item_configuration table, therefore it must be indicated that the search will be carried out by the u_name which is the field that contains the name of the configuration item.
    • The countryside u_glide_list is a choice field, you don’t need to enter the searchBy property, the ServiceNow API for choice fields receives the value of value of the entity “sys_choice_“, because of this values in AFLS and ServiceNow will be related.

    Values to be related from the field u_glide_list and the towns from AFLS:

    ServiceNow “u_glide_list” field VALUE SERVICENOW
    Bogota 1
    Bucaramanga 2
    Santa Marta 3
    Cities in AFLS ID
    Bogota 16
    Bucaramanga 17
    Santa Marta 18

    14. To complete the configuration in the Choice and Reference types, you need to add the mapping property for both cases and the searchBy property for the Reference type.

    {
        "model": [
            {
                "state": {
                    "key": "state",
                    "mapping": [
                        {
                            "value": "1",
                            "id": 187
                        },
                        {
                            "value": "2",
                            "id": 188
                        },
                        {
                            "value": "3",
                            "id": 189
                        },
                        {
                            "value": "5",
                            "id": 190
                        },
                        {
                            "value": "6",
                            "id": 191
                        }
                    ]
                },
                "services": [
                    15
                ],
                "additionalFields": [
                    {
                        "id": 286,
                        "field": {
                            "key": "u_campo_num"
                        }
                    },
                    {
                        "id": 287,
                        "field": {
                            "key": "u_texto_corto"
                        }
                    },
                    {
                        "id": 288,
                        "field": {
                            "key": "u_glide_list"
                        },
                        "mapping": [
                            {
                                "id": 16,
                                "value": "1"
                            },
                            {
                                "id": 17,
                                "value": "2"
                            },
                            {
                                "id": 18,
                                "value": "3"
                            }
                        ]
                    },
                    {
                        "id": 298,
                        "field": {
                            "key": "u_reference_12",
                            "SearchBy": "u_name"
                        }
                    }
                ]
            }
        ]
    }
    


    ↩ Return