How to get the start time and end time of a scheduled job

amaradiswamy
Kilo Sage

Hi All,

As per our requirement, we need to run three scheduled jobs in an order. for now, we have estimated the time and kept timers in workflow for that particular time. Is there any way to know the time in which a scheduled job started and ended, so that i can kept that condition and then that process will be fine. Please provide your suggestions.

Thanks & Regards,

Swamy

8 REPLIES 8

I put gs.log at the top and bottom of the scheduled job:



gs.log('Starting scheduled job', '$$$$ - SCHED JOB');



//Scheduled Job here



gs.log('Ending scheduled job', '$$$$ - SCHED JOB');



Then you can search all logs for the source $$$$ - SCHED JOB and find the time.


Deepak Ingale1
Mega Sage

I agree with Paul has said.



Create a schedule job.


At the end of the schedule job, fire an event.


Use script action which runs based on the event and then call the next schedule job using this script action and repeat the process so on...


Hi Paul,Mike,Deepak,



Thank you so much for your valuable replies.



Hi Deepak,



what is the activity used to invoke script action and inb script action how can i query to know whether the event in the first scheduled job was triggered or not.



Regards,


Swamy


Creating a Scheduled Job - ServiceNow Wiki



find_real_file.png



You can configure something like shown in the diagram. I would suggest to check below wiki links as well.



Workflow Events - ServiceNow Wiki


Calling workflow from script