Issue
Symptoms
When trying to save the variable value in another field using a script sys_id being displayed instead of name
Release
Madrid
Cause
Expected behaviour. It is storing the sys_id in the field as per the script used if the variable is a reference field:
current.<field_name> = current.variables.<variable_name>;
Resolution
Suggest to use the getDisplayValue() method to fetch the display name of the colleague. Something along the following lines:
current.variables.<variable name>.getDisplayValue()
Please refer the following documentation for further information on 'Reference' variables :
https://docs.servicenow.com/csh?topicname=r_VariableTypes.html&version=latest