ServiceNow Email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 11:28 AM
For all impacted carriers except for Kaiser ASO, ROM Task opened exceeds 5 BD and should continue till the ROM Task is CLOSED. This is to increase the governance on ROM Tasks closures. The email content can read "ROM Task is OPEN. Please take immediate action. SLA is 10 BD from the ROM Task Opened Date"
For PMOs where impacted carrier is Kaiser ASO, ROM Task opened exceeds 1 BD and should continue till the ROM Task is CLOSED. This is to increase the governance on ROM Tasks closures. The email content can read "ROM Task is OPEN. Please take immediate action. SLA is 10 BD from the ROM Task Opened Date"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 12:30 PM
Hi @AzanR
We can't help you if you only cut and paste parts of your stories/requirements. You need to explain what you need help with.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 01:38 PM
Thanks for the advise
Basically what i want to do is when a PMO TASK (whose pmo task type is ROM) is opened more than 5 days and this is for all impacted carrier expect Kaiser ASO. So after 5 days the system auto send an email daily to the caller that this is pmo task is opened more than 5 days please close it.
And only for kaiser ASO impacted carrier field it should send email after 1 day of PMO task type ROM
AND both should continue sending email until they close
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2025 02:27 PM
Hi @AzanR,
can you please explain what have you done so far and where exactly you got stuck?
Your post is too vague, are you using (work)flow, scheduled job, notification triggered by an event, conditions, etc...
Please let us know how can we help you and share with us screenshots or configurations to understand better your blockers
/* If my response wasn’t a total disaster ↙️ ⭐ drop a Kudos or Accept as Solution ✅ ↘️ Cheers! */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2025 05:44 AM - edited 07-02-2025 07:04 AM
Basically what i want to do is when a PMO TASK (whose pmo task type is ROM) is opened more than 5 days and this is for all impacted carrier expect Kaiser ASO. So after 5 days the system auto send an email daily to the caller that this is pmo task is opened more than 5 days please close it.
And only for kaiser ASO impacted carrier field it should send email after 1 day of PMO task type ROM
AND both should continue sending email until they close
I am try to do this with schedule job and stuck in the script logic can you help me in this script
var romTaskGR = new GlideRecord('sc_task'); // Use your ROM task table name
romTaskGR.addQuery('state', '!=', '3'); // Not Closed
romTaskGR.addQuery('u_carrier', 'Kaiser ASO'); // Impacted carrier
romTaskGR.query();
while (romTaskGR.next()) {
var opened = new GlideDateTime(romTaskGR.getValue('opened_at'));
var now = new GlideDateTime();
var diffMS = GlideDateTime.subtract(now, opened).getNumericValue(); // in milliseconds
var days = Math.floor(diffMS / (1000 * 60 * 60 * 24));
if (days > 5 && romTaskGR.assigned_to) {
var user = new GlideRecord('sys_user');
if (user.get(romTaskGR.assigned_to)) {
var assigneeEmail = user.email;
var supervisorEmail = '';
// Get manager email
if (user.manager) {
var mgr = new GlideRecord('sys_user');
if (mgr.get(user.manager)) {
supervisorEmail = mgr.email;
}
}
// Send Email
var subject = "ROM Task is OPEN - SLA Breached (Kaiser ASO)";
var body = "Task " + romTaskGR.number + " has been open for more than 5 days.\n\n"
+ "Opened At: " + romTaskGR.getDisplayValue('opened_at') + "\n"
+ "Carrier: " + romTaskGR.u_carrier + "\n"
+ "Please take action immediately.";
gs.email(
assigneeEmail,
supervisorEmail + ",example@wipro.com",
subject,
body
);
gs.info("Email sent for Task: " + romTaskGR.number);
}
}
}
this is the script but it is not working