Issue with the Email Notification Trigger condition
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2023 09:43 PM
I need to set 3 notifications for Problem_Task according to the due date:
a. ACTION REQUIRED - Problem Task is Overdue (0 days crossed)
b. ACTION REQUIRED - Escalation for Overdue Problem Task (14 days crossed)
c. ACTION REQUIRED - Second Escalation for Overdue Problem Task (28 days crossed)
Each notification should only trigger once per Problem Task
While I am changing the due date during testing, all the 3 notifications triggered together, which should not be the case. Please check the screenshot.
Please find the screenshot of the three 'When to Send'
a. ACTION REQUIRED - Problem Task is Overdue (0 days crossed)
b. ACTION REQUIRED - Escalation for Overdue Problem Task (14 days crossed)
c. ACTION REQUIRED - Second Escalation for Overdue Problem Task (28 days crossed)
I need help in two cases.
1. Please review and let me know where I am making the mistake
2. "Each notification should only trigger once per Problem Task" - The notification should not trigger every day.
'1st notification should trigger while the due date just passed 0 days'
'2nd notification should trigger while the due date just passed 14 days'
'3rd notification should trigger while the due date just passed 28 days'
If there is no action taken on the PTSK or the due date is unchanged, how to set this condition properly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2023 10:17 PM - edited ‎11-21-2023 10:23 PM
From your condition set, I can see that if Today is after 28 days from Due Date that also means it after 14 and 0 days.
And also, your notifications are only triggered when the problem task record get updated. That means if there's no update performs, these notifications will not being triggered.
Let's try to fire events in a scheduled job, you can compare to the current date.
1. If Today is equal to Due Date > Fire the 1st event > Trigger 1st Notification
2. If Today is equal to Due Date + 14 days > Fire the 2nd event > Trigger 2nd Notification
3. If Today is equal to Due Date +28 days > Fire the 3rd event > Trigger 3rd Notification
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2023 10:20 PM
So for the notification conditions,
'1st notification should trigger while the due date just passed 0 days' - your condition showing 0 hours & not 0 days
Now, if your 3rd notification condition is true, that means, your 1st & 2nd will also be true.
Now, if your 2nd notification condition is true, that means, your 1st will also be true.
So set conditions as below:
1. Due date is more than 0 days than org. due date & less than 14days from Org. Due date
2. Due date is more than 14 days than org. due date & less than 28days from Org. Due date
3. Due date is more than 28 days.
If you want notification to trigger once per problem task,
then in the advanced condition section in notification, write a gliderecord on sys_email table and check for any logs in this table with the subject line of the mail.
eg.
answer = true;
var gr = new GlideRecord('sys_email');
gr.addQuery('subject', '=', 'ACTION REQUIRED - '+current.taskNumber);
gr.query();
while (gr.next()) {
answer = false;
break;
}
Basically it'll set answer as false if there's already a log with your subjectline for the particular task. that means notificaiton is already triggered for that task. so in that case your notification will not be triggered
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2023 09:18 PM
Hi DSam1,
Could you please show me how to setup these three conditions,
1. Due date is more than 0 days than org. due date & less than 14days from Org. Due date
2. Due date is more than 14 days than org. due date & less than 28days from Org. Due date
3. Due date is more than 28 days.
I can setup the first part the the less than condition is not correct according to me, please help to correct it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2023 09:35 PM
Hi @Kaushik Ghosh ,
Just add the two conditions with AND operator, so each notification will have 2 conditions each.
Can you just let me know, what's due date & what's original due date? How do they change? is origial due date fixed always?