Restrict problem task closure rights to the members of Specific assignment group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-28-2025 08:45 PM
I am new to ServiceNow development. We have a requirement to restrict problem task closure rights to the members of Specific assignment group. The new assignment group say "ABC" is already created. Can someone please help on how can I proceed further? If any ACL needs to be created for this and what should be steps ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2025 01:07 AM
share your script please along with BR configuration
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2025 11:26 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2025 11:37 PM
you didn't copy the script as it is and you should pass group name directly
// give the group name here
if (!gs.getUser().isMemberOf('Problem Task Owner Group')) {
gs.addErrorMessage('You do not have permission to close this task');
current.setAbortAction(true);
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-05-2025 08:57 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-04-2025 01:19 AM
Hi @snehasaha ,
Create before insert/update br on problem task table and use below script.
if (!gs.hasRole('admin')) { // Allow admin to close if needed
var groupCheck = false;
var assignedGroup = current.assignment_group.getDisplayValue();
if (assignedGroup == 'ABC') {
groupCheck = true;
}
if (!groupCheck) {
gs.addErrorMessage("Only members of the 'ABC' assignment group can close this Problem Task.");
current.setAbortAction(true);
}
}
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------