Skip to content

Commit 51f6b2f

Browse files
committed
1233: complete example 4; customize-freshservice
1 parent d760a67 commit 51f6b2f

7 files changed

Lines changed: 39 additions & 29 deletions

File tree

docs/integration/external-integrations/freshservice-integration/customize-freshservice.mdx

Lines changed: 39 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ sidebar_position: 3
55

66
import ThemedImage from '@theme/ThemedImage'
77
import useBaseUrl from '@docusaurus/useBaseUrl'
8+
import fsAdminImage from '/assets/images/freshservice-integration/fs-admin.png'
9+
import fsInventoryMenuImage from '/assets/images/freshservice-integration/fs-inventory-menu.png'
810

911
:::tip
1012
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
777779

778780
### Example 4: How To Sync Buildings, Rooms, and Racks From Device42 to Freshservice
779781

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:
781783

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
793789

794-
**Step 1:** Create `Building`, `Room`, and `Rack` as custom asset types in Freshservice.
790+
**Step 1:** Create Building and 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.
795791

796-
<!-- TODO: Add steps for creating asset types in Freshservice -->
792+
1. Go to **Admin** in the ellipses menu (left panel).
797793

798-
**Step 2:** Add the following `<task>` element to your `mapping.xml` file before the `Delete assets from Freshservice that do not exist in Device42` cleanup task to sync buildings.
794+
<img src={fsAdminImage} style={{ width: "50%" }} />
799795

800-
The DOQL query fetches data from `view_building_v1`. The [`<mapping>` element](#the-task-element-elements) maps the returned fields to the `Building` asset type in Freshservice, grouping them under the **General** and **Building** sections.
796+
2. Search for "Asset Types & Fields"
797+
798+
![Asset Types & Fields](/assets/images/freshservice-integration/fs-search-asset.png)
799+
800+
3. Find the **DataCenter** parent asset type and click the **plus symbol** to add the asset types.
801+
802+
![Add new asset types](/assets/images/freshservice-integration/fs-parent.png)
803+
804+
4. Verify that the new asset types are added by going to **Inventory** and clicking **Add New**.
805+
806+
<img src={fsInventoryMenuImage} style={{ width: "50%" }} />
807+
808+
The **Asset Type** dropdown will display the new asset types.
809+
810+
![New asset type dropdown](/assets/images/freshservice-integration/fs-dropdown.png)
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.
801815

802816
<details>
803817
<summary>Click to expand the Building task</summary>
@@ -840,9 +854,7 @@ The DOQL query fetches data from `view_building_v1`. The [`<mapping>` element](#
840854

841855
</details>
842856

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.
846858

847859
<details>
848860
<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
877889

878890
</details>
879891

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.
883893

884894
<details>
885895
<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
916926

917927
</details>
918928

919-
:::note
920-
Before syncing relationships, confirm that the **Located In** and **Houses** relationship types are available in your Freshservice instance. <!-- TODO: SME to verify whether these relationship types exist by default in Freshservice or need to be created manually -->
921-
:::
922-
923-
**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.
929+
**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.
924930

925931
<details>
926932
<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
978984

979985
</details>
980986

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.
982990

983991
<details>
984992
<summary>Click to expand the code block</summary>
@@ -1005,7 +1013,9 @@ from view_rack_v1 r
10051013

10061014
</details>
10071015

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.
10091019

10101020
<details>
10111021
<summary>Click to expand the code block</summary>
357 KB
Loading
57 KB
Loading
192 KB
Loading
62.2 KB
Loading
362 KB
Loading
261 KB
Loading

0 commit comments

Comments
 (0)