- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 01:24 PM
Hello,
Prior to update to Helsinki, update on the alm_asset and cmbd_ci table records are working correctly. Now as an asset/ci is retired or any values change, it reverts or re-populate fields with their previous values. It was said to be bi-directional, as what I'm told, and I was wondering where I should start in identifying the problem.
Thank you.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2017 10:30 AM
It appears your setAssignedTo() function checks to see if the source has a user name to assign. Using similar logic, we can add an additional if condition and not continue when the Status [install_status] is Retired:
function setAssignedTo() {
var userName = source.u_v_gs_compute_stem_username0;
if (JSUtil.nil(userName)) {
return;
}
if (target.install_status == 7) { //retired
return;
}
var x = userName.indexOf("\\");
if (x > -1) {
userName = userName.substring(x + 1);
}
target.assigned_to = GlideUser.getSysId("user_name", userName);
}
Hopefully that is the field you are using as well as the value. You may need to adjust if it is different.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2017 01:44 PM
My guess is that your Assets and CI mappings should be reviewed. ServiceNow has utilities that you can use:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2017 07:11 AM
Apologies. Forgot to state that the updates on alm_asset and cmbd_ci table tables are coming from the SCCM integration. SCCM re-populates the "Assigned to" of its previous value on a retired asset/ci. How do we stop SCCM from doing this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2017 07:39 AM
Since this is an integration, you should be able to change the transform map for that field to not populate if the target record has a given state. For more information on changing the transform, see the following wiki article:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2017 08:34 AM
Here is the transform map script that we have :
runIt();
function runIt() {
determineClass();
setAssignedTo();
setCorrelationID();
}
function determineClass() {
// Determine the class of the target CI
if (source.u_v_gs_system_systemrole0 == "Workstation")
target.sys_class_name = "cmdb_ci_computer";
else
target.sys_class_name = "cmdb_ci_win_server";
}
function setAssignedTo() {
var userName = source.u_v_gs_compute_stem_username0;
if (JSUtil.nil(userName))
return;
var x = userName.indexOf("\\");
if (x > -1)
userName = userName.substring(x + 1);
target.assigned_to = GlideUser.getSysId("user_name", userName);
}
// This function fixes the fact that when transforming a integer to a string field, it includes the commas
function setCorrelationID() {
target.correlation_id = source.u_v_gs_compute_tem_resourceid + '';
}
Where do I need to make the changes?