Relationship of additional states and fields to ServiceNow class properties
This section relates the states between the platforms and the additional fields to the fields of the ServiceNow classes, for this the model of the configuration JSON, which has the following structure:
{
"model": [
{
"reference": "",
"services": [ 0 ],
"state": {
"key": "",
"mapping": [
{
"value": "",
"id": 0
}
]
},
"additionalFields": [
{
"id": 0,
"field": {
"key": "",
"searchBy": ""
},
"mapping": [
{
"id": 0,
"value": ""
}
],
"value":{
"id": 0,
"value": ""
}
}
]
}
]
}
Properties
The following is a description of the properties of the above json
| Properties | Description | |
|---|---|---|
| Services | Identifier for services in AFLS | |
| Reference | Unique identifier to create a relationship between the concepts workOrder > model, client, company, priority, service | see |
| state | Relationship of AFLS and ServiceNow Status Values | See |
| additionalFields | Relationship of AFLS Additional Fields to ServiceNow Class Fields | See |
List of states
In Aranda Field Service (AFLS) It is managed in 5 states:
- Open
- Process
- StandBy
- Executed
- Cancel
Each of the states is associated Sub-States, which allow a transition between states, for integration it is necessary to relate the sub-states to the ServiceNow states.
To relate the states, the integration provides the following json schema:
{
"state": {
"key": "",
"mapping": [
{
"value": "",
"id": 0
}
]
}
}
The following is a description of the internal properties of the state object
| Properties | Description | |
|---|---|---|
| Key | Name or ID of the field in ServiceNow where the value will be found and updated. | ServiceNow Properties |
| mapping | Relationship between state values in AFLS and ServiceNow | |
| value | ServiceNow status identifier (sys_id if it is a “Reference” type field or value if it is a “Choice” type field) | ServiceNow Properties |
| Id | Status Identifier in AFLS |
EXAMPLE: AFLS/ServiceNow Status Relationship
To create the list of states, follow the instructions below:
- Get the IDs of the AFLS states.
- Get sys_id or value from ServiceNow statuses.
- Assign the following status equivalence:
- On the property Key type the name of the state-related field in ServiceNow.
| Status in ServiceNow | State in Aranda | ID STATE ARANDA | VALUE STATE SERVICENOW |
|---|---|---|---|
| New | NEW | 1 | value_new |
| Closed | CLOSED | 13 | value_closed |
- Type the ID STATE ARANDA On Property “id” and the VALUE STATE SERVICENOW of its equivalent taken from ServiceNow On Property value:
{
"state": {
"key": "state",
"mapping": [
{
"value": "value_new",
"id": 1,
"subState": 10
},
{
"value": "value_closed",
"id": 2,
"subState": 13
}
]
}
}
Relationship between additional fields and fields in ServiceNow classes
additionalFields internal properties
{
"id": 0,
"field": {
"key": "",
"searchBy": ""
},
"mapping": [
{
"id": 0,
"value": ""
}
],
"value": {
"id": 0,
"value": ""
}
}
The following is a description of the internal properties of the additionalFields object
| Properties | Description | |
|---|---|---|
| Id | Additional field identifier in AFLS | |
| field | ServiceNow Field Information, Learn More | see |
| mapping | The relationship between AFLS and ServiceNow field values, where “id” is the identifier in AFLS and “value” is the identifier in ServiceNow (sys_id if it is a “Reference” type field or value if it is a “Choice” type field) | |
| value | Add a default value to the field |
List of additional supported field types
List of relationship between the types of fields of the platforms:
| AFLS | Field ID in ServiceNow | Field Name/Label in ServiceNow |
|---|---|---|
| Short Text | String | String |
| Paragraph | String | String |
| Date and Time | glide_date_time, calendar_date_time | Date/Time, Calendar Date/Time |
| Numeric | Integer, Longint | Integer, Long |
| List | choice, glide_list, reference | Choice, List, Reference |
⚐ Note:
- Associating 2 different fields to those listed in the previous table results in a runtime error***
- Associating a ServiceNow field with multiple additional AFLS fields will replace the previous value***