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

Abhinandan Pati
Giga Guru

Hi Hima,



Are you sure that you are not missing parentheses after 'getUser'? It should be 'gs.getUser().getName()'



Thanks


Abhinandan


Sanjeev Kumar1
Kilo Sage

Hi,



Try like this



var currentUser = gs.getUser();


gs.info(currentUser.getName());


thakkallapallay
Tera Contributor

Hi Hima,


The code which has to execute might be placed somewhere ( any server side script). There might be condition in for the script to run. This condition might be the reason to   make it run for only itil user. Please check the condition.


Thanks,


Ramya.


hcp
Tera Contributor

Hi,



Here is piece of my code . I am executing this on before query business rule.


var n=gs.getUser();


gs.log('user name'+ n.getName());



it is showing 'user name system' as log entry.