Get the current user's manager and Current user's group manager in the filters.

Santhosh40
Giga Expert

Hi Experts, I need to get the records based on the following conditions/filters:

I want a filter option called “Assigned Manager” that shows Incidents where the User Reference entered is:

1. The Manager of a User in the Assigned_to field,

or

2. is the Manager of the Assignment group to which it was assigned.

---------> I had tried to the with following filters as

"Assigned_to.manager - is - gs.getUserID()"

or

"Assignment_group.manager - is - gs.getUserID()". - > but it get the records which are assigned to the current user.

Can you please share your thought to achieve this requirement.

Thanks in advance for your valuable thoughts

Thanks

Santhosh.K

 

1 ACCEPTED SOLUTION

Mark Roethof
Tera Patron
Tera Patron

Hi there,

Have you tried using:

gs.getUser().getManagerID();

Also have a look at:
https://www.servicenowguru.com/scripting/user-object-cheat-sheet/

Kind regards,
Mark

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

View solution in original post

7 REPLIES 7

Thank you guys for your valuable time and suggestions,

As of my Requirement: 

Need to set default filter for a specific module as follows:

1. Assigned to.manager: Get the list of records of current users manager  ---

For the above condition, I had added "Assigned_to.manager - is - javascript:gs.getUser().getManagerID()" filter.

2. Assignment_group.manager: Get all the list of groups records, where the current user's manager, act as a manager.

For the above condition, i had Added "Assignment_group.manager - is - javascript:gs.getUser().getManagerID()" filter.

 

Now It's working as expected.

May this post will helpful for some one, in future.....

Again, Thank you every one(Mark, Rahul, and Asifnoor) to responding to my post.

Thanks

Santhosh.K

Santhosh40
Giga Expert

Thank you guys for your valuable time and suggestions,

As of my Requirement: 

Need to set default filter for a specific module as follows:

1. Assigned to.manager: Get the list of records of current users manager  ---

For the above condition, I had added "Assigned_to.manager - is - javascript:gs.getUser().getManagerID()" filter.

2. Assignment_group.manager: Get all the list of groups records, where the current user's manager, act as a manager.

For the above condition, i had Added "Assignment_group.manager - is - javascript:gs.getUser().getManagerID()" filter.

 

Now It's working as expected.

May this post will helpful for some one, in future.....

Again, Thank you every one(Mark, Rahul, and Asifnoor) to responding to my post.

Thanks

Santhosh.K

Okie. Kindly mark my comment as helpful if it has helped.