Prevent assignment group manager approving change request when state is assess
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2024 12:48 PM
Hi There,
This is my first ever post to the community. I am relatively new to being a ServiceNow administrator. I would like some help implementing this requirement "Prevent assignment group manager approving change request when state is assess" This is my code below, also I can't actually tell if it is runs.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2024 10:40 PM
@Shane_Waka You can create a business rule like to following and cancel the approval.
Here is the script.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
//Check if the approver is the manager of change request assignment group and change request is in Assess state
if(current.parent.state=='-4'&&gs.getUserID()==current.parent.assignment_group.manager){
gs.addInfoMessage('Assignment Group Manager can not approve the change request if it is in Assess state');
current.setAbortAction(true);
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2024 11:05 PM
Hi Sandeep Rajput Thank you for providing this, I will see how this works in our Dev environment. I will get back to you with my results.
Thanks a again much appreciated