- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2015 09:44 AM
When a user goes inactive we need to check if that user was a manager of a group or if that user was a member of a group. If the user is a member of a group we will remove them from that group. If they were a manager of that group we need to replace that user with their manager and notify the manager that they have been assigned the group manager.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2015 10:48 AM
A business rule on sys_user that says:
before Insert
condition current.active.changesTo('false')
var group = new GlideRecord('sys_user_group');
group.addQuery('manager', current.sys_id);
group.query();
while(group.next()){
group.manager = current.manager;
group.update();
gs.eventQueue('group.manager.changed', group, group.manager, current.name);
}
var grmember = new GlideRecord('sys_user_grmember');
grmember.addQuery('user', current.sys_id);
grmember.query();
while(grmember.next()){
grmember.deleteRecord();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2019 10:13 AM
Thanks! That was the route we went.