How to trigger/execute/run an on-demand scheduled job from Business rule script
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 03:53 AM
I want to trigger a scheduled job from Business rule. I am using the below script but its throwing error.
var gr = new GlideRecord('sysauto');
gr.addQuery('sys_id','25b758811b6e8d102d8a0d45ec4bcb35');
gr.query();
if (gr.next()) {
SncTriggerSynchronizer.executeNow(gr);
gs.info("Successfully executed the Scheduled Job");
}
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 04:10 AM
A business rule is triggered in some kind of way. Why not just use that trigger on your scheduled job? It sounds like a few too many steps to get the result.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2024 04:28 AM