Due Date Approval record - Add notes if due date passes?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 11:24 AM
Hey experts!
We currently requiring comments if they reject an approval which works great when they select reject. On a lot of our approvals through Flow Designer, we have a due date to auto reject after x days.
Our question is is there somehow we can write a note in the comments saying this was rejected because the due date has elasped?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 11:33 AM
@Adam Peterson You can make use of scheduled job and make it to run on daily basis to check the records which has the due date passed.
var gr = new GlideRecord('sysapproval_approver');
gr.addQuery('state', 'requested'); // assuming the state, you can provide as per your requirement
gr.addQuery('due_date', '<=', new GlideDate());
gr.query();
while (gr.next()) {
gr.comments = "Due date passed. Adding a note.";
gr.update();
}
})();
Mark my answer helpful if it works 🙂