Notifications

401 views

For all the customers upgrading to London, the variable set is now treated as a first class citizen and as a result of this, a catalog item cannot have a variable set(internal_name) and a variable (name) with the same name.

This has been mentioned in the London release notes.

https://docs.servicenow.com/bundle/london-release-notes/page/release-notes/it-service-management/service-catalog-rn.html

 

The following is a script which will help the customers upgrading to London identify the variables which have this configuration.

It is recommended to run this script after an upgrade to London.

 Script:

 

(function() {
   var variables = new GlideRecord('item_option_new');
   variables.query();
   while(variables.next()) {
      var varSet = variables.getValue('variable_set');
      var varName = variables.getValue('name');
      if (!varSet)
         continue;
      else {
         var varSetGr = new GlideRecord('item_option_new_set');
         varSetGr.addQuery('sys_id', varSet);
         varSetGr.query();
         if (varSetGr.next())
            if (varSetGr.getValue('internal_name') === variables.getValue('name'))
               gs.print('Variable name and Internal name of the variable set are the same for ' + varName);
      }
   }
   var gr = new GlideRecord('io_set_item');
   gr.query();
   while (gr.next()) {
      var varSetName = gr.variable_set.internal_name;
      var catItem = gr.getValue('sc_cat_item');
      var variables = new GlideRecord('item_option_new');
      variables.addQuery('cat_item', catItem);
      variables.query();
      while (variables.next()) {
         if (variables.name == varSetName) {
            gs.print("Variable name is same as variable set name for " + varSetName);
            break;
         }
      }
   }
}
)();

--------------------------------------------

Running this in the background scripts will give us the list of variables/variable sets which are wrongly configured.

 

For Further info, please review: KB0720638 - London Service Portal Catalog item - Required Information broken when the Variable Set title is same as name of a mandatory Variable

 

Article Information

Last Updated:2019-01-17 05:21:30
Published:2019-01-17