Want to capture schedule job in update set

kritikasingh
Tera Contributor

If I want to capture Schedule job in update set how I can achieve that?

3 REPLIES 3

Mark Manders
Mega Patron

You need to force it to an update set or move it through xml. 

There are many solutions out there. This is just one of them: https://developer.servicenow.com/connect.do#!/share/contents/5042084_include_in_update_set_a_single_...


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

jcmings
Mega Sage

You can force it to your update set. Here's a quick walk-through of how to create a Form Link (displays in Related Links) that can force any record to your current update set.

 

  1. Head on over to System Definition > UI Actions and create a New record
  2. In the Name field, enter Force to Update Set
  3. Choose a Table of Global [global]
  4. Checked the box to make Form link true
  5. Set the Order to 100, and Action name to whatever you want (or leave empty)
  6. Show update checkbox should be true, but Show insert should be false
  7. I've added the condition gs.hasRole('admin')
  8. Add this code to your script:

 

//Commit any changes to the record
current.update();
//Check to make sure the table isn't synchronized already
var tbl = current.getTableName();

//Push the update into the current update set
var um = new GlideUpdateManager2();
um.saveRecord(current);

//Query for the current update set to display info message
var setID = gs.getPreference('sys_update_set');
var us = new GlideRecord('sys_update_set');
us.get(setID);

//Display info message and reload the form
gs.addInfoMessage('Record included in <a href="sys_update_set.do?sys_id=' + setID + '">' + us.name + '</a> update set.');
action.setRedirectURL(current);

 

 

This will allow you to force the current record you're looking at to the update set you're currently in. Please note that you should confirm the application scope of the forced record after clicking on the UI link. You can do this by pulling in the Application field to the Customer Updates related list on your update set record. I mention this because some Global scope records (e.g. sys_user_group records) get forced into your current update set; you'll have to move those to an update set of the proper application scope to prevent future retrieval errors.

Ravi Chandra_K
Kilo Patron
Kilo Patron

Hello @kritikasingh 

You can use Add to Update set utility where you can add any ServiceNow record into update set.

you can install the utility from share link given by Mark.

 

Please mark the answer as helpful and correct if helped. 

Kind Regards,

Ravi Chandra