Notifications

27 views

Description

Symptoms

Location Field on some CIs imported from SCCM is empty

Release

Issue occurs irrespective of version being used

Cause

When CI records from SCCM are imported on import set table, it populates the data in u_username field of on import set table.

Transform Map - SCCM 2012 v2 Computer Identity is responsible for populating the computer CIs from Import Set table to target table - cmdb_ci_computer. 

The Transform Map holds a script to validate data in u_username field with data on sys_user table and the sys id of correct record on sys_user table is added in assigned_to field on the target table.

Location of user who is selected in assgined_to field is populated in location field on target table - cmdb_ci_computer.

 

In Case if u_username in import set table field doesn't have value, system doesn't populate value in assigned_to and location field on target table.

 

Below is the script used - 

 

function setAssignedTo() {
var userName = source.u_username;
if (JSUtil.nil(userName))
return;

var x = userName.indexOf("\\");
if (x > -1)
userName = userName.substring(x + 1);

var nameField = gs.getProperty('glide.discovery.assigned_user_match_field', "user_name");
var userSysID = GlideUser.getSysId(nameField, userName);
target.assigned_to = userSysID;

var gr = new GlideRecord('sys_user');
gr.addQuery('sys_id',userSysID);
gr.query();

if(gr.next()){
target.location = gr.location.getUniqueValue();
target.department = gr.department.getUniqueValue();
}
}



Note - System property - glide.discovery.assigned_user_match_field holds a value of column name on sys_user table.
The script mentioned above verifies the value in u_username field to the field mentioned as value in property - glide.discovery.assigned_user_match_field.

Another contributor for location to be set on target record is a business rule - Update location as needed
https://<instance_name>.service-now.com/nav_to.do?uri=sys_script.do?sys_id=b8f3b061933202002f217a75e57ffb2e


Resolution

This is a data issue in SCCM. Ask customer to correct data in SCCM so that it pushes correct value in u_username column on import set table.

Article Information

Last Updated:2019-08-11 23:49:27
Published:2019-08-12