Keeping Assigned To from approving their own change
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-04-2010 10:22 AM
I'm looking for ideas on keeping the assigned to from approving their own changes. Whenever a change is created, the approval group is the ("approver: " + assigned group) that is tasked for that particular change. If the assigned to is a member of both the assignment group and approval group, they will have the ability to approve their own change. I would like to be able to limit or not allow the assigned to the ability to approve their own change. Any ideas on how to go about and completing this task?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2010 12:09 AM
something along these lines but changing the field names to the ones you need:
var user = gs.getUserID();
var myUserObject = gs.getUser();
var owner = current.parent.u_change_owner;
var requestor = current.parent.u_requested_by;
//gs.log(user + owner + requestor);
if (user == owner){
gs.addInfoMessage('You are the owner of the change, therefore not authorised to approve');
current.setAbortAction(true);
}
else if (user == requestor){
gs.addInfoMessage('You are the requestor of the change, therefore not authorised to approve');
current.setAbortAction(true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2010 07:16 AM
I actually need to be able to delete the user from the list of approval users on the approvers tab. I believe your code only inspects the change itself not the approvals.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2013 12:38 AM
I am looking to do the same. Did you find a resolution for this please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2010 08:11 AM
just created this bus rule and it appears to work. I'm still testing it out.
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval',current.sys_id);
gr.addQuery('approver',current.assigned_to);
gr.query();
while(gr.next()){
gr.deleteRecord();
}