Map Suppurt Group Change Group and Managed By Group using the excel file that has CI Class name

hanwar2
Kilo Sage

Hi All, 

 

I am trying to Map Support Group, Change Group and Managed By Group using the excel file that has CI Class name and corresponding Managed by Group, Support Group, Change Group. 

 

I tried to load the data from excel file using import set and when trying to run Transform Map, not able to find the "Class" in Target field of CMDB_CI. 

 

I tried to create a custom column sys_class_name but it is not mapping correctly. 

 

Please suggest. 

 

CSV Column ServiceNow Field (cmdb_ci)

Classsys_class_name (Class)
Managed By Groupmanaged_by
Support Groupsupport_group
Change Groupchange_group
Filtered URLreference_url
6 REPLIES 6

Selva Arun
Mega Sage
Mega Sage

Hi  ,

 

It seems like you're trying to map the Support Group, Change Group, and Managed By Group fields in the CMDB using an Excel file that includes the CI Class name. Let me guide you through the process and address the issue you're facing with the sys_class_name field.

 

Steps to Map the Fields:

  1. Verify the Target Table and Fields:
    • Ensure that the target table is cmdb_ci or a specific CI class table (e.g., cmdb_ci_server, cmdb_ci_win_server).
    • The sys_class_name field is a system field that determines the CI class. It is not directly editable in the transform map because it is automatically populated based on the CI's class.
  2. Prepare Your Excel File:
    • Your Excel file should have the following columns:
      • Class: Contains the CI class name (e.g., cmdb_ci_server, cmdb_ci_win_server).
      • Managed By Group: The group responsible for managing the CI.
      • Support Group: The group providing support for the CI.
      • Change Group: The group responsible for changes to the CI.

Example:

Class

Managed By Group

Support Group

Change Group

cmdb_ci_server

IT Operations

IT Support

Change Mgmt

cmdb_ci_win_server

Windows Team

Help Desk

Change Mgmt

  1. Load the Data Using Import Set:
    • Navigate to System Import Sets > Load Data.
    • Upload your Excel file and create a new import set table.
    • Map the columns in your Excel file to the import set table fields.
  2. Create a Transform Map:
    • Go to System Import Sets > Transform Maps and create a new transform map.
    • Set the Source Table to your import set table and the Target Table to cmdb_ci (or the specific CI class table if applicable).
    • Map the fields as follows:
      • Class → sys_class_name (Target Field)
      • Managed By Group → managed_by
      • Support Group → support_group
      • Change Group → change_group
  3. Handle the sys_class_name Field:
    • Since sys_class_name is a system field, it cannot be directly mapped. Instead, you need to use a Scripted Transform Map to set the sys_class_name dynamically based on the value in the Class column.
  4. Scripted Transform Map for sys_class_name:
    • Add an onBefore Transform Script in your transform map with the following code:

 

// Map sys_class_name dynamically based on the Class column if (source.u_class) { // Replace 'u_class' with the actual field name in your import set table target.sys_class_name = source.u_class; }

    • This script ensures that the sys_class_name field is populated correctly based on the Class column in your Excel file.
  1. Run the Transform Map:
    • After setting up the transform map, run it to import the data into the target table.
    • Verify that the Managed By Group, Support Group, and Change Group fields are populated correctly for the respective CIs.
  2. Validate the Data:
    • Navigate to the CMDB and check the records to ensure the data has been mapped correctly.
    • Use a list view to verify that the sys_class_name, managed_by, support_group, and change_group fields are populated as expected.

Troubleshooting Tips:

  1. If sys_class_name is not mapping correctly:
    • Ensure the values in the Class column of your Excel file match the exact names of the CI classes in ServiceNow (e.g., cmdb_ci_server, cmdb_ci_win_server).
    • Use the scripted transform map to dynamically set the sys_class_name.
  2. If fields like managed_by, support_group, or change_group are not updating:
    • Check the field mappings in the transform map.
    • Ensure the field names in the Excel file match the source field names in the import set table.
  3. If the transform map is not working as expected:
    • Check the Coalesce settings in the transform map. Use a unique identifier (e.g., sys_id or name) to match existing records and update them.

Supporting Documentation:

Here are some resources that can help you further:

  1. How to update sys_class_name via Transform Map script? - ServiceNow Community
  2. [Mapping of Class field in cmdb_ci table - ServiceNow Community](https://www.servicenow.com/community/developer

If you believe the solution provided has adequately addressed your query, could you please **mark it as 'Helpful'** and **'Accept it as a Solution'**? This will help other community members who might have the same question find the answer more easily.

 

Thank you for your consideration.


Selva Arun

Thanks @Selva Arun for your detailed response. 

 

Can you please help with these steps in detailed steps as I am facing issue mapping Class from excel file to Class in CMDB_CI Class as target

3.Handle the sys_class_name Field:

    • Since sys_class_name is a system field, it cannot be directly mapped. Instead, you need to use a Scripted Transform Map to set the sys_class_name dynamically based on the value in the Class column.

4. Scripted Transform Map for sys_class_name:

    • Add an onBefore Transform Script in your transform map with the following code:

 

// Map sys_class_name dynamically based on the Class column if (source.u_class) { // Replace 'u_class' with the actual field name in your import set table target.sys_class_name = source.u_class; }

    • This script ensures that the sys_class_name field is populated correctly based on the Class column in your Excel file.

Hi @Selva Arun 

 

In the transform map, I added below script: 

 

I replaced "u_class" with "Class" as the excel sheet header has the same name for Class (screenshot below) 

 

hanwar2_0-1742237656895.png

 

hanwar2_1-1742237751239.png

 

When I ran the transform, I see only the Class with Configuration Item has been added with Support Group, Change Group, Managed By Group. 

hanwar2_3-1742237938018.png

 

Rest of the CI Class there is no update in those fields

 

hanwar2_4-1742238014688.png

 

 

I am also adding the Transform Map screenshot

hanwar2_2-1742237883420.png

 

please help. 

 

Let me know if you need any more information

@Selva Arun I also noticed that new CI entries are being made with Support Group, Change Group and Managed by Group updated. 

Instead of updating the CI class which are already existing in CMDB

 

hanwar2_0-1742240168838.png