The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Do isMemberOf() method works for Managers?

Vasu ch
Kilo Sage

Hi,

I've a requirement to check if the loggedin user is member or manager for a group or not. For this is used gs.getUserId().isMemberOf('my group') method. Its working for the group members. But when manager logs in its not working. But I read somewhere in community that this method works for managers too. Is it right? Or Are there any further things I should do?

1 ACCEPTED SOLUTION

Hi,

the issue is coming because Luke Wilson who is group manager is not group member

In that case you need to query Group table and get manager and then check in sys_user_grmember table if that user is member or not

There is no direct way for this

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

9 REPLIES 9

Avinash_Patil1
Giga Guru

Hi 

 

Please share your script here

Vasu ch
Kilo Sage

find_real_file.png

is this a scope application? It doesnot work in SCOPED APPLICATION

 

Hi Avinash,

I'm using this function in ACL. And currently I'm working globally