Change Approval Policies - Prevent user from approving if they are in the Technical Approvers .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2020 01:56 PM
Change Approval Policies - Prevent user from approving if they are in the Technical Approvers . Prevent user from approving their own Change request
I am using Change Approval policies, and the Change Management workflows as OOB.
When I was using workflow approval activities for previous clients, I could script something to prevent users approving their own Change Requests. But now I have policies, with decisions, and cannot for the life of me see where I can add a script that would (hopefully) remove the requested by person from the approvers related list.
There are lots of suggestion on here with Business rules, but they are not very clean. I was wondering if anyone had a good solution fro removing an approver, if they are also the person making the request? Also, we have to conside most approvals are done via the portal, or email.
Tough times, stay safe. Thanks
- Labels:
-
Change Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2021 04:26 PM
One way is to introduce a check on whether someone else other than requestor has approved.
You will need to configure additional policy input and then check that in the change approval policy activity input.
Maybe there is another way to stop the approval record being generated using BR but doesn't seem to fit right.
Change Policy Input -
New field u_other_than_requestor (type true/false) default: false
In the workflow: 'change approval policy' activity
Approval policy is the above policy where you created the input. This way you can do multiple checks etc.
Policy Input:
answer = {
// Configure additional policy inputs here
u_other_than_requestor: false
};
answer.u_other_than_requestor = OtherThanRequestorhasApproved(current.requested_by);
//check for approval other than the requestor.
function OtherThanRequestorhasApproved(requestorSysId){
if(JSUtil.nil(requestorSysId))
return true;
var grApproval = new GlideRecord('sysapproval_approver');
grApproval.addQuery('document_id', current.getUniqueValue());
grApproval.addQuery('approver','!=',requestorSysId);
grApproval.orderByDesc('sys_created_on');
grApproval.query();
return grApproval.next() && grApproval.getValue('state') === 'approved';
}
Please mark correct if helpful.