Need to exclude the requestor from approving the change request
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11m ago
Hi All
I am using the flow designer for approval process but here i need to exclude the requestor from approving the change request, how can we achieve this. In rules section can we use both code and configuration, i have tried it is not working for me
(function execute(inputs, outputs) {
// Get the Change Request record
var changeGR = new GlideRecord('change_request');
if (!changeGR.get(inputs.changeSysId)) {
return;
}
// Determine requester (requested_by preferred, fallback to opened_by)
var requester = changeGR.requested_by || changeGR.opened_by;
if (!requester) {
return;
}
// Remove requester from approval list if present
var appr = new GlideRecord('sysapproval_approver');
appr.addQuery('sysapproval', changeGR.sys_id);
appr.addQuery('approver', requester);
appr.addQuery('state', 'requested');
appr.query();
while (appr.next()) {
appr.deleteRecord();
}
})(inputs, outputs);
0 REPLIES 0
