SCCM updates on alm_asset and cmdb_ci tables

jiral
Giga Sage

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.

1 ACCEPTED SOLUTION

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.


View solution in original post

7 REPLIES 7

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.


Thanks ccajohnson for the help.


Hi,

I was looking for something related to the status changes in servicenow CMDB for computer records. Do we have anything from SCCM which sets the install_status ?