Trigger Scheduled Job from Business Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2022 03:32 AM
How do I trigger a scheduled job from the business rule and send the values from the business rule to the scheduled job that is being triggered?
Currently, I am using this to trigger the Scheduled job, but I want to also send values to the scheduled job from the business rule.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2022 04:13 AM
Hi,
Write below script in the advanced area of the BR to trigger the SJ.
var schImp_GR = new GlideRecord('sysauto');
schImp_GR.addQuery('name','<name>'); // Name of the scheduled job
schImp_GR.query();
if(schImp_GR.next()){
SncTriggerSynchronizer.executeNow(schImp_GR); // this is for global scope
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2022 05:40 AM
Hi Ankur,
Thanks for your response. I am able to run the scheduled job but how will I get the current values from the business rule into the scheduled job.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2022 06:47 AM
hi,
You can write like below:
SncTriggerSynchronizer.executeNow(current);
I am not sure what you are going to implement in Scheduled Job. But the way i suggest will work.
For better understanding can you please explain what functionality you are going to implement in SJ from the current object of BR.
May be after getting the better understanding i can help you with some better stuff.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-06-2022 11:02 PM
Hi Ankur,
The scenario is, we have two catalog items. Based on the approval of Cat item 1, the Cat item 2 should be created by using the values of what we have in Cat item 1. I wrote a BR to submit a Cat item 2 after approval of Cat item 1.
But the problem is the system is creating the Cat item 2 in the name of the person whose approval is triggering this business rule. I want that to be changed for which I will be using the "Run As" field on the scheduled job.