Is it possible to capture scheduled job code in an update set?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2022 06:49 AM
We have created a scheduled job in an update set. Is it possible to push these changes in an update set vs pushing xml? We have been told scheduled job code can't be pushed via update set and we would like to confirm.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2022 07:09 AM
Out of the box they are not captured.
But here is an alternative if you wish to push it to an update set
Manually Add a Record to an Update Set
Steps
1) ensure you are in correct update set
2) run this script in background script
//Query for the record
var rec = new GlideRecord('sysauto_script');
rec.get('973c8e8a9d022000da615b13b3a22f32'); // give the sysId of scheduled job here
//Push the record into the current update set
var um = new GlideUpdateManager2();
um.saveRecord(rec);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2022 07:16 AM
When you are viewing the Scheduled Job you should see this Related Links option:
So, as long as you are currently in the correct Update Set, clinking the link will capture the Scheduled Job (and all the conditions/script) in the Update Set. Please note that you will need to do this every time you make an update to the Scheduled Job while developing/testing it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2022 07:21 AM
Please refer to this below blog on what i said about "Add to update set" Action
https://developer.servicenow.com/connect.do#!/share/contents/9824957_add_to_update_set_utility?v=7.3&t=PRODUCT_DETAILS
Please accept the solution if you find it useful