Emails from a scheduled job getting deleted from logs after 30 minutes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 07:10 AM
Hi, there is a scheduled job that runs daily at 7 am and sends an email out to some people. It seems to be running fine and sends out the email to the relevant people but the logs/sent emails are getting deleted after 30 minutes. What could be causing this issue?
I have checked the Archive destroy rules and there is only one on sys_email table and thats set to destroy emails after 366 days.
There are no business rules as such on the sys_email table which would cause this.
The scheduled job is conditional
var answer = false;
var dayCheck = new lbgDateUtils;
var dayOfWeek = dayCheck.checkDay();
if (dayOfWeek == 2 || dayOfWeek == 3 || dayOfWeek == 4 || dayOfWeek == 5) {
answer = true;
}
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 07:16 AM
Hi @snow_beginner ,
Hello,
As per ServiceNow documentation:-
So now the above is true for OOB configuration. You will have to check the configuration on your instance. For that go to Archive rules and Archive destroy rules:-
And then check for sys_email:-
There you will find the condition which you can change if required:-
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2024 07:18 AM
Hi @snow_beginner ,
Try to inactivate and check if it's causing issue still. if not then check any other schedule job written on sys_email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 04:07 AM
Hi @d_17 the issue is only happening with this scheduled job report. I think a HI case will be needed as I couldn't find anything which may have caused this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2024 04:15 AM
ServiceNow includes functionality to automatically clean up sent notifications after a certain period. Even though there's no explicit business rule on the sys_email table, there might be a system setting or plugin configured to delete sent emails after a certain timeframe. Check the system properties or plugins related to notifications to see if there's any configuration affecting the cleanup of sent emails.
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks