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-19-2023 05:37 AM
Run below fix script or background script:
Var grMem = new GlideRecord('sys_user_grmember');
grMem.addQuery('sys_id', ' ' ); // Pass the sys_id of Incident User Group
grMem.query();
while(grMem.next())
{
var inc = new GlideRecord('incident');
inc.query('assigned_to',grMem.user);
inc.query();
if(inc.getRowCount==0)
{
grMem.deleteRecord();
}
}
NOTE: Please execute the script in PDI or dev instance before executing in prod as this is not tested.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 06:10 AM
Can I write Business rule at incident table for above solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 06:20 AM
This is a server side script and will run on BR as well, but it depends on your requirement.
BR will trigger on insert or update, do you want to trigger it on insert/update of incident?
My suggestion will be to write a scheduled job which runs daily and do this operation in the backend.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2023 10:58 PM
Hi Raghav,
As per my requirement, the user will be removed immediately, the above script is not working for Business rule at incident table, please provide me another script.
Thanks,
Srinath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2023 12:15 AM
Share your BR conditions and your script.
Raghav
MVP 2023