The Packages Call Removal Tool provides modules to identify fields that might contain scripts, find scripts that contain Packages calls to ServiceNow Java classes, and to examine proposed script changes that eliminate those Packages calls.

Note: This tool is not activated by default, and is only available to users with the admin role.
Packages calls to ServiceNow Java classes will be prevented in a future release. The Packages Call Removal tool helps prepare your instance to use the new API and includes the following scripts and pages:
  • The Find Packages Fields script scans scripts for Packages calls to ServiceNow Java classes.
  • The Find Packages Calls script proposes changes that remove Packages calls or replaces them with GlideScriptable names.
  • The Packages Call Items page lists and enables you to work on proposed changes to scripts.

The tool might generate errors as it tries to generate preferred, scriptable alternatives for Packages calls to ServiceNow Java classes.

Note: Create an update set before migrating the changes that result from running the Packages Call Removal Tool. For information, see Get started with update sets.

Activate the Packages Call Removal Tool

You must activate the Packages Call Removal Tool plugin to access the tool.

Before you begin

Role required: admin.

Procedure

  1. Navigate to All > System Applications > All Available Applications > All.
  2. Find the Packages Call Removal Tool plugin using the filter criteria and search bar.

    You can search for the plugin by its name or ID. If you cannot find a plugin, you might have to request it from ServiceNow personnel.

  3. Select Install to start the installation process.
    Note: When domain separation and delegated admin are enabled in an instance, the administrative user must be in the global domain. Otherwise, the following error appears: Application installation is unavailable because another operation is running: Plugin Activation for <plugin name>.
    You will see a message after installation is completed. For information about the components installed with a plugin, see Find components installed with an application.

Find a Packages call

After you run the Find Packages Fields script to define the list of fields to search for Packages calls, run the Find Packages Calls script to generate the list of fields with Packages calls to ServiceNow Java classes. The script also proposes changes.

  1. Click (3) Find Packages Calls (script) to execute a script that searches the fields for packages calls and populates the Packages Call Items list with proposed changes.
    Figure 1. Find Packages Calls
    Shows the find package calls script results
  2. Click (4) Packages Call Items to display the list of affected fields on the Packages Call Items page.
    The Packages Call Items page lists the items with Packages calls, shows each item's current state, the table that contains the field, the affected record, the number of Packages calls contained in the field's script, and the number of errors that occurred when the proposed script was generated.
    Figure 2. Packages Call Items
    Packages call items
  3. On the Packages Call Items page, click a record for any of the listed items to open the form and revise as described in Replacing Packages Calls.

    As you work through the list, the State of the items are updated and the items are grouped by State:

    • Proposed: A proposed revision exists for the field.
    • Error(red): One or more errors occurred when the proposed script was generated.
    • Rejected(gray): A proposed change has been rejected.
    • Completed(green): The field has been successfully revised to remove Packages calls to ServiceNow Java classes.
    • Canceled (gray): Since the proposed change was generated, either the original script has been changed to no longer require modification, or the original record no longer exists.

Glide object name

The names of the new Glide objects that replace Packages calls are derived from the Java package name used in the Packages call.

About this task

Although the tool automatically substitutes the appropriate new scriptable name for each Packages call it encounters, in some circumstances it can be useful to know how to manually replace a Packages call with its new scriptable object equivalent. Use the steps below to determine the new script object name from the Packages call name. The replacement objects include the same methods and properties as the objects they replace.

To determine the new object name:

Procedure

  1. Note the third term in the Java package name.
    This term is usually glide, but is sometimes snc or glideapp.
  2. Drop all of the prefix terms, leaving only the last.
    For example, Packages.com.glide.monitor.AbstractBucketCollector becomes AbstractBucketCollector.
  3. Capitalize the first letter of the term noted in the first step above and add it to the front of the term defined in step 2.
    For example, Packages.com.glide.monitor.AbstractBucketCollector becomes GlideAbstractBucketCollector and Packages.com.snc.cmdb.BaselineCMDB becomes SncBaselineCMDB.
  4. Verify that the name is valid by executing a gs.print() command in Scripts Background, specifying only the name with no quotes.
    For example:

    gs.print( SncBaselineCMDB );

    *** Script: [JavaClass com.snc.cmdb.BaselineCMDB]

    Note that there are exceptions to this rule, such as "Glide", which replaces "Packages.com.glide.Glide", "TestExtension", which replaces "Packages.com.glide.junit.misc.TestExtension"; and "UINotification", which replaces "Packages.com.glide.ui.UINotification".

Glide object replacement list

This table lists the Glide classes and the Packages calls they replace.

Note: The publication of this list does not imply that these scriptable objects are for use by customers, consultants, and partners. The use of the Glide prefix does not imply that these scriptable objects are in the same category as or have the same status as objects such as GlideRecord. Except where documentation is provided in the API Reference, these undocumented APIs are not intended for general use, and ServiceNow, Inc., does not make any commitment to document them, answer questions about them, or maintain them indefinitely in their current form. Over time, ServiceNow, Inc., intends to migrate a subset of the functionality represented by these objects into the documented API and remove the rest.

Packages Call Removal Tool error types

Possible error types generated by the Packages Call Removal Tool.