How to get Manager of Manager's Manager of User as default value

SURESH KUMAR TH
Tera Contributor

Dear All,

How to get How to get Manager of Manager's Manager of User as default value?

Please help me. Thank you in advance

find_real_file.png

4 ACCEPTED SOLUTIONS

asifnoor
Kilo Patron

You can get like this.

gs.getUser().getUserByID(gs.getUser().getUserByID(gs.getUser().getManagerID()).getManagerID()).getManagerID()

Kindly mark the comment as a correct answer and also helpful once worked.

View solution in original post

Cody Smith _ Cl
Tera Guru

Hello Suresh,

You will need to keep nesting further and further into the User. It will look very confusing very quickly, but should be 

gs.getUser().getUserByID(gs.getUser().getUserByID(gs.getUser().getManagerID()).getManagerID()).getManagerID()

Where you will be adding 

gs.getUser().getUserByID

inside of the getUserByID.

 

I hope this helps explain it!

 

If this solved your problem, please mark as correct or helpful.

Thank you,

Cody Smith

View solution in original post

Thats awesome! 

Could you mark my answer correct if it helped you?

Thank you. 

View solution in original post

Hi,

Glad it helped. If my comment has helped you to achieve your requirement, would suggest you to mark it as correct answer so that the question is moved to the solved list.

View solution in original post

8 REPLIES 8

Pooja Mallikarj
Kilo Sage

Hi,

Refer the below link

https://community.servicenow.com/community?id=community_question&sys_id=06cdcb6ddb9cdbc01dcaf3231f96...

 

mark correct/helpful if it helps for you

Regards,

Pooja

sureshkumarthor
Kilo Contributor

Dear Asifnoor & Smith,

 

Thank you very much. your code is working fine.

Here just summarizing the code.

 

find_real_file.png

 

 

For the catalog field : We need to add the below code under Default value of the field.

javascript:(add the script) like as below

 

find_real_file.png

Thats awesome! 

Could you mark my answer correct if it helped you?

Thank you. 

Hi,

Glad it helped. If my comment has helped you to achieve your requirement, would suggest you to mark it as correct answer so that the question is moved to the solved list.