Revoke group access based on the incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 05:26 AM
Hi Everyone,
Group: Incident User Group
If User is not part of any incident (for example user don't have any incident in his bucket) should be removed from above group (Incident User Group).
Thanks,
Srinath Kolipakula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2023 01:00 AM
I wrote this business rule in the incident table
the condition is when to run is assigned to changes
the script, i written by
var grMem = new GlideRecord('sys_user_grmember');
grMem.addQuery("group.name", "Incident Holders");
grMem.addQuery("user", previous.assigned_to);
grMem.workflow(false);
grMem.query();
while (grMem.next()) {
var user = grMem.user;
var inc = new GlideRecord('incident');
inc.addQuery('assigned_to', grMem.user);
inc.query();
if(!inc.next()){
grMem.deleteRecord();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2023 01:03 AM
grMem.addQuery("group.name", "Incident Holders"); // pass the sys_id of group not name
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2023 04:08 AM
Hi Raghav,
still, it is not working even though I give logs as well, it is also not executed in that Business rule.