Import Variables into Description Field / RITM

adamrauh
Kilo Expert

What's the best way to import the variables from ESS Service Catalog offerings into the Description field as text in REQ's/RITM's?

 

Several of our request have numerous variables, and I'm finding they look chunky and crowded when populating in the 'Variables' field in the REQ/RITM, so I'm wondering the way to just take this variable data from the service catalog offerings and import it as text into the 'Description' field.

 

Since we use Short Description/Description in Incident anyways, this will help tech's make the transition because the form will be more like what they're used to seeing.

9 REPLIES 9

Ian Kirby1
Giga Expert

When you create a catalogue task for your technical team to process, tick the Advanced option and use the script field to modify the task.description field using the variable references (current.variables.xxxx). This gives the technicians the information they need without having to pull the variables directly on to the task.



For the Request Item view, you can utilise the same Catalogue UI policies to display the variable information in the same way as on the catalogue item request screen. There are options on the UI Policy and Client Script to also apply on the Request Item or the Catalogue Task.


Thanks - but wouldn't that only apply to the task and/or CI?   Right now we're not directly tying our service requests to CI's (we haven't implemented much ITAM yet), or Tasks (tech's are working directly off RITM's) so would this be done at the workflow level (or business rule?)


Brad Tilton
ServiceNow Employee
ServiceNow Employee

Hi Adam,



I've used a script like this in a before insert business rule on the requested item table before to populate variables into a notes field. If you search the community there are a few other methods as well.



var desc = 'Variables:';


for (key in current.variables) {


  var v = current.variables[key];


  desc += '\n' + v.getGlideObject().getQuestion().getLabel() + ": " + v.getDisplayValue();


}


current.description = desc;


Hi Brad,



Is there a way to populate the variables according to order of the question ?



Regards,


Harikrishna Tatikonda.