Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to Display User Department in Catalog item Variable

ch_karthikeya
Tera Contributor
1 ACCEPTED SOLUTION

Hi Ashutosh,



i requested currently logged in   user Department only



now i got the result :   javascript: gs.getUser().getDepartmentID();




find_real_file.png


View solution in original post

12 REPLIES 12

Current User Department, i need to display


HI,



Want i want to say is, the person who is raising a request or there is any field such as requested for?



For current logged in user we have to do it via Client script and script include.



Thanks,


Hi Ashutosh,



i requested currently logged in   user Department only



now i got the result :   javascript: gs.getUser().getDepartmentID();




find_real_file.png


Hi Karthikeya,



Can you try and put "javascript:gs.getUser().getDepartmentID();" under Default value of your Variable name department.



Regards,
Kshitiz


Hi Kshitiz,

 

I tried the above line in variable default value but department field is pooping only sys_id & not the name.

I tried

javascript:gs.getUser().getDepartmentID(); &

javascript:gs.getUser().getDepartmentID.name(); but no luck.

Please suggest

find_real_file.png