- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello, Everyone.
I found the sys_scheduler_job_history table, but unfortunately, it doesn't seem to record the start time, end time, or success/failure status.
I believe that outputting messages to the system log and then searching through them to find what I need is not a very "smart" or efficient implementation.
Does anyone know if there is a standard table or feature that records the start time, end time, and execution status of scheduled jobs?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
that's correct, you won't get exact start time, end time and any success/error details
you need to handle that using gs.info() statements and use try catch block to throw any exception
Something like this
(function() {
try {
gs.info("My Scheduled Job ABC started" + new GlideDateTime());
// your code
gs.info("My Scheduled Job ABC ended" + new GlideDateTime());
} catch (ex) {
gs.info("Exception in scheduled job ABC" + ex);
}
})();
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Thanks, @Ankur Bawiskar . @Its_Azar .
As you mentioned, it seems that the only way to output the data within the default features is through logs.
I found a similar discussion, so I’ll include the link here as a reference to make it easier for others to find.
https://www.servicenow.com/community/developer-forum/where-to-find-job-log-for-a-scheduled-job-that-...
https://www.servicenow.com/community/itom-forum/how-to-check-the-log-of-a-scheduled-job/m-p/2720398
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi there @Ankur Bawiskar
I always log my custom apps using gs.infos. like ankur mentioned you can get these timings and logs them using GS.info.
Kind Regards,
Azar
Serivenow Rising Star ⭐
Developer @ KPMG.
