- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 12:54 PM
We want to run a scheduled job only if a previous scheduled job was succesful. Is there a way to check to see if a scheduled job was succesfully run for the day, so that when the second scheduled job starts running, a condition can be set to only continue if the previous job was succesful?
Thanks in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 05:26 AM
You could try triggering the other job at the end of the first one with this:
var rec = new GlideRecord('sysauto_script');
rec.get('name', 'YOUR_JOB_NAME_HERE');
SncTriggerSynchronizer.executeNow(rec);
So adding that to the end of your script would require the script to finish first. Just add any conditions you might have to recognize the first script did what it had to do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 05:26 AM
You could try triggering the other job at the end of the first one with this:
var rec = new GlideRecord('sysauto_script');
rec.get('name', 'YOUR_JOB_NAME_HERE');
SncTriggerSynchronizer.executeNow(rec);
So adding that to the end of your script would require the script to finish first. Just add any conditions you might have to recognize the first script did what it had to do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 07:47 AM
Thank you very much for this solution!