- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2020 05:02 AM
Hi,
I'm writing a business rule on User table, this business rule should execute only if the user is part of a specific group.
Can some one help how to put in Condition in advanced tab. I had a property created with the group Sys id
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2020 05:40 AM
Or without toString:
gs.getUser().getUserByID(current.sys_id).isMemberOf(gs.getProperty('name of your property'))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2020 05:03 AM
Use this to check whether the user is part of a group or not
gs.getUser().isMemberOf(current..PASSGROUPNAME)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2020 05:21 AM
gs.getUser will return the Logged in User, but I wanted to check the User whose record is updated is part of the group

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2020 05:27 AM
Add this conditon and it will work.
gs.getUser().getUserByID(current.sys_id).isMemberOf(gs.getProperty("groupo_name"))
Check property name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2020 05:08 AM
Hi,
If this is not an scoped app, then try (gs.getUser().isMemberOf("Group Name");
If an scoped app then, have an script include which returns true / false and call the script include in BR condition.
var gr = new GlideRecord('sys_user_grmember');
gr.addQuery('group','group_sys_id');
gr.addQuery('user', gs.getUserID());
gr.query();
if(gr.hasNext() {
answer = true;
}