logo

NJP

Service Catalog Util

Import · Jun 07, 2022 · article

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(, true);Parameter 1 is the SCTASK object

Parameter 2 is a boolean, to indicate whether or not to add MRVS in the returned result.

View original source

https://www.servicenow.com/community/itsm-articles/service-catalog-util/ta-p/2304020