logo

NJP

Return logged-in user groups using getMyGroups()

Import · Dec 25, 2021 · article

Hi All,

Today I have found an amazing undocumented API that outputs all logged-in user group sys_id(s). You can use this to reduce the amount of scripting image

You can try this in your Background script

gs.print(gs.getUser().getMyGroups())

Output :

image

Regards,

Sai Kumar

View original source

https://www.servicenow.com/community/developer-articles/return-logged-in-user-groups-using-getmygroups/ta-p/2313796