How to find last run 24 Hours scheduled jobs with status ?

Khasim Shaik2
Kilo Explorer

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.

4 REPLIES 4

Paul Curwen
Giga Sage

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. find_real_file.png

 

if that helps please mark as helpful

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul

Khasim Shaik2
Kilo Explorer

I did not find any column to pull last 24 hours run jobs

Maik Skoddow
Tera Patron
Tera Patron

Hi @Khasim Shaik 

to the best of my knowledge there is not such a log you are looking for.

Kind regards
Maik

shloke04
Kilo Patron

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:

Take a look at System Logs->Transactions (Background)

 

find_real_file.png

 

 

 

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke