The Zurich release has arrived! Interested in new features and functionalities? Click here for more

gs.getUser

hcp
Tera Contributor

After upgrade to helsinki we have issue in gs.getUser.getName() function. When we impersonate person with ITIL role function provide expected output. but when we logged in as user with but when we impersonate user with no role it give undefined.

6 REPLIES 6

If you want the detail of other your, you don't need to impersonate. You can achieve that like below.



var ourUser = gs.getUser();


gs. ­print( ­ourUser. ­getFirstName());


ourUser = ourUser. ­getUserByID( ­'abel.tuter');


gs. ­log( ­ourUser. ­getFirstName());



To get user information for a particular user, first retrieve the current user, and then use that object's getUserByID method to fetch a different user using the user_name field or sys_id on the target record.


var name=gs.getUserName();


  gs.log("Your name is:"+name);



Try with this.