- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2014 10:32 AM
Scripting is still a very new to me.... that being said does anyone have scripting (or a different way) to prevent the requester of a change request form from being included in the list of approvers. On occasion the requester of a change request is also in the approving group and we don't want their name to come up in the list in the this case.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2014 02:09 PM
In the activity properties you will need to remove the "IT Infrastructure Managers" group from the groups field and instead script the members. You click on the "Advanced" field and then a script section will show up. The following script will add anyone within this group to the approvers list unless they are the requested_by user.
answer = [];
var approvers = new GlideRecord('sys_user_grmember');
approvers.addQuery('group.name', 'IT Infrastructure Managers');
approvers.query();
while(approvers.next()) {
if(approvers.user.toString() != current.requested_by.toString()) {
answer.push(approvers.user.toString());
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2015 02:58 PM
Hi,
I have a similar request, I am adding the members in the group to the approver list. I am able to traverse through the group and get the users, but even if one person from the group has approved I want to set other as not required. How can add that condition in the above script. I am using similar script in the approval type definition (item designer).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2015 02:57 PM
I apologize for not responding to this sooner... It will set the others as not required as long as you set the "Wait for" option on the Approval Activity to "Anyone to approve".