- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2022 11:35 PM
Apart from Assigned to and Group member, tickets should not be closed by anyone.
Requirements:
When tickets moved from one group to another.Restrict Previous group&group members to close ticket and make current group&group members only able to close/resolve tickets.
SCRIPTING:CLIENT SCRIPT
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2022 11:41 PM
Hi,
how are tickets getting closed? is it via some Close UI Action
you can update the UI action visibility for your requirement
Your earlier Conditions && current.assigned_to == gs.getUserID() || gs.getUser().isMemberOf(current.assignment_group+'')
If no UI action then you can validate this using before update business rule on that table
Script:
if(current.assigned_to == gs.getUserID() || gs.getUser().isMemberOf(current.assignment_group+'')){
// allow
}
else{
// not allowed
gs.addErrorMessage('Not allowed to close');
current.setAbortAction(true);
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2022 11:40 PM
You can create a Before Business rule and check whether the user is member of the assignment group. If not call throw error message and call current.setAbortAction(true); to cancel the updation
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2022 11:41 PM
Hi,
how are tickets getting closed? is it via some Close UI Action
you can update the UI action visibility for your requirement
Your earlier Conditions && current.assigned_to == gs.getUserID() || gs.getUser().isMemberOf(current.assignment_group+'')
If no UI action then you can validate this using before update business rule on that table
Script:
if(current.assigned_to == gs.getUserID() || gs.getUser().isMemberOf(current.assignment_group+'')){
// allow
}
else{
// not allowed
gs.addErrorMessage('Not allowed to close');
current.setAbortAction(true);
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2022 12:09 AM
Thank you for marking my response as helpful.
If my response helped you please mark it correct to close the question so that it benefits future readers as well.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-07-2022 12:14 AM