Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
**Proactive Change Request Reminder (Due in 24 Hours)**

**Description**
This Scheduled Job sends an automated email reminder to the assigned agent of each Priority 1 Change Request that is due within the next 24 hours.
It helps teams stay ahead of deadlines, prevent SLA breaches, and ensure timely change implementation.

**When to Use**
Use this script to ensure that high-priority change requests are addressed on time by proactively notifying assigned engineers.

**How It Works**
Checks all active change_request records with:
- priority = 1
- state not in "Closed" or "Complete"
- due_date within the next 24 hours
Sends an email reminder to the assigned agent with the change number, description, and due date.

**Scheduled Job Configuration**
Recommended schedule:
- Run: Periodically
- Repeat interval: 1 hour
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//Get current time and time after 24 hours
var now = new GlideDateTime();
var after24Hours = new GlideDateTime();
after24Hours.addSeconds(24 * 60 * 60);

//Query for high-priority Change Requests due within 24 hours which are not closed or complete
var gr = new GlideRecord('change_request');
gr.addQuery('priority', 1);
gr.addQuery('state', 'NOT IN', '3,4');
gr.addQuery('due_date', '>=', now);
gr.addQuery('due_date', '<=', after24Hours);
gr.query();

while (gr.next()) {
var assignedTo = gr.assigned_to.getRefRecord();
if (assignedTo && assignedTo.email) {
//Email reminder
var mail = new GlideEmailOutbound();
mail.setSubject('Proactive Reminder: ' + gr.number + ' is due within 24 hours');
mail.setBody(
'Hi ' + assignedTo.name + ',\n\n' +
'This is a reminder that the following Change Request is due within the next 24 hours:\n\n' +
'Change Request: ' + gr.number + '\n' +
'Short Description: ' + gr.short_description + '\n' +
'Due Date: ' + gr.due_date.getDisplayValue() + '\n\n' +
'Please review and take the necessary actions.'
);
mail.addAddress('to', assignedTo.email);
mail.send();
}
}
Loading