You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This page covers advanced data mapping customization and XML file editing.
@@ -777,27 +779,39 @@ If you want Device42 to update `asset_state` values, set `skip-update` to `"fals
777
779
778
780
### Example 4: How To Sync Buildings, Rooms, and Racks From Device42 to Freshservice
779
781
780
-
By default, the `mapping.xml` file does not sync building, room, or rack data from Device42 to Freshservice. The following steps are based on version 6.0 of the default `mapping.xml` file and cover how to:
782
+
By default, the `mapping.xml` file does not sync Building, Room, or Rack data from Device42 to Freshservice. The following steps, based on version 6.0 of the default `mapping.xml` file, walk you through how to set this up:
781
783
782
-
1. Create `Building`, `Room`, and `Rack` as custom asset types in Freshservice
783
-
2. Sync buildings
784
-
3. Sync rooms
785
-
4. Sync racks
786
-
5. Sync relationships between rooms and buildings
787
-
6. Sync relationships between racks and rooms
788
-
7. Delete buildings that no longer exist in Device42
789
-
8. Delete rooms that no longer exist in Device42
790
-
9. Delete racks that no longer exist in Device42
791
-
10. Delete relationships between rooms and buildings that no longer exist in Device42
792
-
11. Delete relationships between racks and rooms that no longer exist in Device42
784
+
- Create Building and Room as custom asset types in Freshservice (Rack is available by default)
785
+
- Sync buildings, rooms, and racks
786
+
- Sync relationships between rooms and buildings, and between racks and rooms
787
+
- Delete buildings, rooms, and racks that no longer exist in Device42
788
+
- Delete relationships that no longer exist in Device42
793
789
794
-
**Step 1:** Create `Building`, `Room`, and `Rack` as custom asset types in Freshservice.
790
+
**Step 1:** Create Buildingand Room as custom asset types in Freshservice. Rack is already available by default under the **DataCenter** parent asset type and does not need to be created.
The **Asset Type** dropdown will display the new asset types.
809
+
810
+

811
+
812
+
**Step 2:** To sync buildings, add the following `<task>` element to your `mapping.xml` file before the `Delete assets from Freshservice that do not exist in Device42` cleanup task.
813
+
814
+
The DOQL query fetches data from `view_building_v1`. The [`<mapping>` element](#the-task-element-elements) maps the returned data to the `Building` asset type in Freshservice, grouping them under the **General** and **Building** sections.
801
815
802
816
<details>
803
817
<summary>Click to expand the Building task</summary>
@@ -840,9 +854,7 @@ The DOQL query fetches data from `view_building_v1`. The [`<mapping>` element](#
840
854
841
855
</details>
842
856
843
-
**Step 3:** Add the following `<task>` element after the Building task to sync rooms.
844
-
845
-
The DOQL query fetches data from `view_room_v1`. The `<mapping>` element maps the returned fields to the `Room` asset type in Freshservice, grouping them under the **General** and **Room** sections.
857
+
**Step 3:** Add the following `<task>` element after the Building task to sync rooms. Similarly, the DOQL query fetches the room data, and the `<mapping>` element maps the returned data to the `Room` asset type in Freshservice, grouping them under the **General** and **Room** sections.
846
858
847
859
<details>
848
860
<summary>Click to expand the Room task</summary>
@@ -877,9 +889,7 @@ The DOQL query fetches data from `view_room_v1`. The `<mapping>` element maps th
877
889
878
890
</details>
879
891
880
-
**Step 4:** Add the following `<task>` element after the Room task to sync racks.
881
-
882
-
The DOQL query fetches data from `view_rack_v1`. The `<mapping>` element maps the returned fields to the `Rack` asset type in Freshservice, grouping them under the **General** and **Rack** sections.
892
+
**Step 4:** To sync racks, add the following `<task>` element after the Room task.
883
893
884
894
<details>
885
895
<summary>Click to expand the Rack task</summary>
@@ -916,11 +926,7 @@ The DOQL query fetches data from `view_rack_v1`. The `<mapping>` element maps th
916
926
917
927
</details>
918
928
919
-
:::note
920
-
Before syncing relationships, confirm that the **Located In** and **Houses** relationship types are available in your Freshservice instance. <!--TODO:SMEtoverifywhethertheserelationshiptypesexistbydefaultinFreshserviceorneedtobecreatedmanually-->
**Step 5:** Add the following `<task>` element after the three asset tasks above to sync relationships between rooms and buildings. The DOQL query joins `view_room_v1` and `view_building_v1`. The `<mapping>` element uses `downstream-relationship` and `upstream-relationship` attributes to define the **Located In** – **Houses** relationship type between each room and its parent building.
924
930
925
931
<details>
926
932
<summary>Click to expand the Room to Building relationship task</summary>
@@ -978,7 +984,9 @@ Before syncing relationships, confirm that the **Located In** and **Houses** rel
978
984
979
985
</details>
980
986
981
-
**Steps 7–9:** To delete buildings, rooms, and racks that no longer exist in Device42, locate the `Delete assets from Freshservice that do not exist in Device42` cleanup task near the bottom of your `mapping.xml` file (see [The `mapping.xml` File Tasks](#the-mappingxml-file-tasks) for an overview of how cleanup tasks work). Add the following `UNION` clauses to the end of its DOQL query, before the closing `"`. Each clause selects the Device42 IDs of all existing buildings, rooms, and racks so Freshservice can identify and remove any that have been deleted.
987
+
**Steps 7–9:** To delete buildings, rooms, and racks that no longer exist in Device42, locate the `Delete assets from Freshservice that do not exist in Device42` cleanup task near the bottom of your `mapping.xml` file (see [The `mapping.xml` File Tasks](#the-mappingxml-file-tasks) for an overview of how cleanup tasks work).
988
+
989
+
Add the following `UNION` clauses to the end of its DOQL query, before the closing `"`. Each clause selects the Device42 IDs of all existing buildings, rooms, and racks so Freshservice can identify and remove any that have been deleted.
982
990
983
991
<details>
984
992
<summary>Click to expand the code block</summary>
@@ -1005,7 +1013,9 @@ from view_rack_v1 r
1005
1013
1006
1014
</details>
1007
1015
1008
-
**Steps 10–11:** To delete relationships between rooms and buildings, and between racks and rooms, that no longer exist in Device42, update both `Delete asset relationships from Freshservice that do not exist in Device42` tasks. The `mapping.xml` file contains two versions of this task for [version compatibility](#the-task-element-attributes) — one with `d42_min_version="19.05.00"` and one with `d42_max_version="19.04.99"`. Add the following `UNION` clauses to the end of each task's DOQL query, before the closing `"`. Each clause selects the current room-to-building and rack-to-room relationships in Device42 so Freshservice can identify and remove any that no longer exist.
1016
+
**Steps 10–11:** To delete relationships between rooms and buildings, and between racks and rooms, that no longer exist in Device42, update both `Delete asset relationships from Freshservice that do not exist in Device42` tasks. The `mapping.xml` file contains two versions of this task for [version compatibility](#the-task-element-attributes) — one with `d42_min_version="19.05.00"` and one with `d42_max_version="19.04.99"`.
1017
+
1018
+
Add the following `UNION` clauses to the end of each task's DOQL query, before the closing `"`. Each clause selects the current room-to-building and rack-to-room relationships in Device42 so Freshservice can identify and remove any that no longer exist.
0 commit comments