How to find last run 24 Hours scheduled jobs with status ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2021 07:49 AM
I want to develop a report as last 24 hours ran scheduled jobs with status, Can you please guide me which table need to refer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2021 08:43 AM
Open the sys_trigger table with sys_trigger.LIST.
Ensure you add the following columns:
- Error Count
- Last Error
You will then be able to search for your Scheduled Job (name) and see the last error message and error count if there are any e.g.
if that helps please mark as helpful
Regards
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2021 08:45 AM
I did not find any column to pull last 24 hours run jobs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-26-2021 07:35 PM
Hi
to the best of my knowledge there is not such a log you are looking for.
Kind regards
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-28-2021 12:31 AM
Hi,
Actually, oddly enough, it seems there is no place where the output of a scheduled job is saved.
That would be quite helpful to have to audit and debug scheduled jobs.
However, a scheduled job is also a transaction in SN : a transaction where the URL starts with JOB: (followed by the scheduled job name).
So, if you look in the SN menu, under System Logs -> Transactions (Background), one would think you would find execution statistics about all executed jobs. But unfortunately, that is not the case. It is actually the same view as the one available under System Scheduler -> Scheduled Jobs -> Slow Job Log. Only scheduled jobs that have an execution time of more than 1 second are shown in those views.
In the end, the sys_trigger table (System Scheduler -> Scheduled Jobs -> Scheduled Jobs) is where you have a record of each scheduled job execution. And adding the Process duration, Run count, Updated and Updated by fields to the sys_trigger table list and form will allow you to have a complete picture of the last job(s) execution.
Note : All this is somewhat confusing and should not to be confused with the scheduled jobs definition, which are found in the sysauto table, under System Definition -> Scheduled Jobs.
I mention it because that is exactly what I did initially : manually creating a scheduled job instance under System Scheduler -> Scheduled Jobs -> Scheduled Jobs, thinking it was where the scheduled jobs were defined, instead of using System Definition -> Scheduled Jobs.
Below is the link from which this reference has been taken:
https://community.servicenow.com/community?id=community_question&sys_id=3c414fe5db98dbc01dcaf3231f9619ba
Also, you can look at below:
Regards,
Shloke
Regards,
Shloke
Take a look at System Logs->Transactions (Background)