User Tools

Site Tools


snc_transform_map_impersonation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
snc_transform_map_impersonation [2018/07/18 11:28]
jackson.davenport updated for notice of not needing this value on target record
snc_transform_map_impersonation [2018/09/26 12:58] (current)
jackson.davenport
Line 21: Line 21:
  
 // Determine the user to use // Determine the user to use
-var uGr = new GlideRecord("​sys_user"​);​ +var email = source.u_assigned_to_email.toString();​ 
-uGr.addQuery("​email", ​source.u_email); +if(email != ""​) { 
-uGr.query();​ +    ​var uGr = new GlideRecord("​sys_user"​);​ 
-if(uGr.next()) { +    uGr.addQuery("​email", ​email); 
-    username = uGr.user_name;​+    uGr.query();​ 
 +    if(uGr.next()) { 
 +        username = uGr.user_name;​ 
 +    }
 } }
  
Line 32: Line 35:
 </​code>​ </​code>​
  
-Where this will use the [u_email] column to lookup a User [sys_user]. ​ You would adjust this to whatever column you have to use. If a user with this email exists it will use this user's user_name. ​ If not, it will use the user with user_name "​Generic_ACME_User"​ (per whatever default user you create).+Where this will use the value passed into the [u_assigned_to_email] column to lookup a User [sys_user]. ​ You would adjust this to whatever column you are using and populating in your Import Set Table. If a user with this email exists it will use this user's user_name. ​ If not, it will use the user with user_name "​Generic_ACME_User"​ (per whatever default user you create).
  
 It will then store this old user on the target record so we can easily access it later in an onAfter Script. It will then store this old user on the target record so we can easily access it later in an onAfter Script.
snc_transform_map_impersonation.txt · Last modified: 2018/09/26 12:58 by jackson.davenport