gliderecord for record created second before
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 06:46 AM
I have this BR which I'm running whenever record in "approved", so that other group approvals get "no longer required".
But , just after 1st group approval , it triggers another approval and they are getting "no longer required" too just after creation.
Can we modify this code such that it should query only those approval record which are genereted 5 sec before current time?
As I have seen approval record are generated within 1 or 2 secs after 1st approval record is approved.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 08:24 AM
It sounds like you do not have your group approval setup correctly. If you set the group approval to approve or reject on the first response the other approvals should automatically be marked as no longer required.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 10:22 PM
we are creating approvals via BR. multiple approval record created in 1st level approval. If any one approves then 2nd level approval triggers to particular group. In 1st level approval, if anyone approves, then rest other are not becoming "no longer required"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 11:00 PM
you should differentiate it using the group field which will tell you the approval record is for which group
I added 1 more addQuery()
function renderTaskApprovalsMoot() {
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('sysapproval', current.sysapproval);
gr.addQuery('group', current.group); // this will search only the records for this group approval
var qc = gr.addQuery('state', 'requested');
qc.addOrCondition('state', 'not requested');
gr.query();
while (gr.next()) {
gr.state = 'not_required';
gr.update();
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 11:05 PM
ideally this should happen OOB if you set approval rule as Anyone 1 person approves
how have you configured the group approval? share screenshots.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader