Scroll down to the list of Field Maps and search for and then click into assigned_to in the Target field. Check the Use source script checkbox, then add the following in the Source script: Code Block |
---|
| answer = (function transformEntry(source) {
if (source.u_assigned_to_email.indexOf('<') == -1)
return "";
var startIndex = source.u_assigned_to_email.indexOf('<') + 1;
var endIndex = source.u_assigned_to_email.indexOf('>');
var email = source.u_assigned_to_email.substring(startIndex, endIndex);
var sgr = new GlideRecord('sys_user');
sgr.addNotNullQuery('email');
sgr.addQuery('email', email);
sgr.query();
if (sgr.next()) {
return sgr.sys_id;
}
return "";
})(source); |
Click Update to save your changes. ![](/download/attachments/28934564/Transform_map_script_assigned_to.png?version=1&modificationDate=1601342606000&api=v2&effects=border-simple,blur-border)
|