- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 06-06-2022 11:22 PM
We have a global utility called GlobalServiceCatalogUtil in ServiceNow to retrieve information related to Catalog items, one of the interesting functions is getVariablesForTask It retrieves all the variables associated with SCTASK in JSON format. Handy util to use in automation scripts.
Pointer: This util is open for any scope but not for modification/extension.
Sample format:
var getVariables = new GlobalServiceCatalogUtil().getVariablesForTask(<pass sc_task rec object>, true);
Parameter 1 is the SCTASK object
Parameter 2 is a boolean, to indicate whether or not to add MRVS in the returned result.
- 1,371 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I just discovered this utility today, but it would have been nice to know about years ago. There doesn't seem to be anything on docs.servicenow.com or in the API reference about this class. This post is the first result if I google the class name.