Append field to short description on requested items

Warren Pilkingt
Mega Expert

I have had a request to see if we can append the short description of one of our request forms in the Service Catalog with the value of one of the fields.

It's so that when the user requests software, the name shows in the short description (and as such appears in the likes of approval emails etc)

I'm trying a "run script" named Append software name to requested item (licenced) to apply straight after the begin section of the workflow, and for some reason the script isn't working.

Based on the variable being named single_software_name_2 I thought that the script would just need to do an append with:

sc_req_item.short_description+=current.variables.single_software_name_2;

However, this doesn't work and shows an error:

Append software name to requested item (licenced)(7ffcc7d34fb2df00c95c69d18110c7a3): org.mozilla.javascript.EvaluatorException: Java class "com.glide.script.GlideRecordBusinessRules" has no public instance field or method named "short_description". (#0(eval); line 1)

I've also tried task_short.description with the same error.

Is there a way to have the script working correctly, or should I look at an onSubmit action which would append accordingly in that instance?

 

1 ACCEPTED SOLUTION

Shashikant Yada
Tera Guru

You need to try with:

current.short_description+=current.variables.single_software_name_2;

Thanks
Shashikant

Hit Helpful or Correct on the impact of response.

View solution in original post

2 REPLIES 2

Shashikant Yada
Tera Guru

You need to try with:

current.short_description+=current.variables.single_software_name_2;

Thanks
Shashikant

Hit Helpful or Correct on the impact of response.

That worked, many thanks for that.  I've added an additional line to add a space and dash before the name, so in effect I now have this:

current.short_description+=' - ';
current.short_description+=current.variables.single_software_name_2;

It's just so it's easier for other admins to read to make it more obvious that we're appending the space and dash first, then appending the variable.