Location on alm_asset record is not updated based on Assigned to, if Assigned to has no location


Description

The business rule 'Update location as needed' updates the location on the alm_asset  & cmdb_ci records if the assigned_to field is updated.  However, this update is skipped if the assigned_to user does not have any location.  This may result in a stale/incorrect location being reflected on the CI / Asset.

Steps to Reproduce

  1. Log on as a user with role 'asset'.
  2. Open any alm_hardware record.
  3. Set status to In Stock and populate the stockroom value.
  4. Save the record - Location is updated to the location of Stock room

Steps where this works fine

    1. Locate a User which has a valid location.
    2. Change the state to In Use and set the Assigned to Value to above user and SAVE record
    3. State is updated and Location of the Asset is changed location of user.

Steps where this breaks

    1. Locate a User which has no value in the location field.
    2. Change the state to In Use and set the Assigned to Value to above user and SAVE record
    3. State is updated however Location remains same as the previous value (the stockroom location or previous users location depending on how the test was performed.)

Workaround

This problem is currently under review. You can contact ServiceNow Technical Support or subscribe to this Known Error article by clicking the Subscribe button at the top right of this form to be notified when more information will become available. In the meantime below workaround can be used:

  1. Hop to the instance and located the Business Rules with name 'Update location as needed'

/sys_script_list.do?sysparm_query=nameSTARTSWITHUpdate%20location%20as%20needed

  1. For business rule on alm_asset, update the condition to remove the check on current.assigned_to.location.nil(), that line 3 should look like

else if (!current.assigned_to.nil() && !current.assigned_to.location.nil())

  1. For business rule on cmdb_ci, simply remove the condition.

Related Problem: PRB1398006