Granular Delegation - Delegate User Criteria
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 01:04 AM
I'm setting up Granular Delegation
And I wanted to setup Delegate User Criteria
My logic is "Allow to delegate to the current user's reportee"
For this I created a new User Criteria and in the script I wrote the below script
But I get the below error
com.glide.script.RhinoEcmaError: Cannot read property "delegate" from null
User Criteria: 'DutyTravel_DelegateRule' : Line(4) column(0)
Im not sure what I should use in the place of "current.delegate" to check if the logged in user is the manager of the delegate. Need help to solve this.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 01:09 AM
Hi,
Use the script to check whether the user is a manager
var grUser = new GlideRecord('sys_user');
grUser.addActiveQuery();
grUser.addQuery('manager', user_id);
grUser.setLimit(1);
grUser.query();
grUser.hasNext();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 08:16 PM
Hi @Shruti ,
Thanks for your reply. This code checks if the logged in user is the manager, then allow to select delegate. But Im trying to achieve is, the logged in user can allow to select only his reportes as delegate person.
Do you know how to achieve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2025 08:18 PM
Hi @Ankur Bawiskar , @Dr Atul G- LNG @SANDEEP DUTTA , can you provide any heads up on this please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2025 01:59 PM
sorry mate, i have no idea about script.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************