Avoiding asking for approval from the same person if they have already approved
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2024 12:51 AM
Hi.
I am looking for a way to avoid repeating requests for approval several times to one person if, for example, is a member of several groups or is designated in several places. I saw that there was a post from Guru that many recommended, but now the page is empty and I don't really know how to approach it.
I will be grateful for help!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-14-2024 01:15 AM
Hi @New user1212 you can create a before insert/update BR on approval table with below code:
script:
approveDuplicateApproval();
function approveDuplicateApproval(){
//Must have link to record being approved
if(current.document_id || current.sysapproval){
//Query for approval records for this user/record
var app = new GlideRecord('sysapproval_approver');
//Handle empty document_id and sysapproval fields
if(!current.document_id.nil()){
app.addQuery('document_id', current.document_id);
}
else if(!current.sysapproval.nil()){
app.addQuery('sysapproval', current.sysapproval);
}
app.addQuery('approver', current.approver);
app.addQuery('state', 'approved');
app.query();
if(app.next()){
//If previous approval is found set this approval to 'approved'
current.state = 'approved';
current.comments = "Approval marked by system as 'Approved' due to a previous approval on the same record by the same user.";
}
}
}
Reference : https://servicenowguru.com/business-rules-scripting_prevent-redundant-approval-requests-servicenow/
Harish