Add specific variables to Incident Description?

Community Alums
Not applicable

Hi All,

I have 2 variables on the incident for via the portal.

What I would like is the variables question and answer to be placed in the backend incident description field underneath the actual incident description but only if the variables have been answered.

I have the below 2 lines within the record producer, can I place something here?

current.short_description = producer.summary;
current.description = producer.comments;

I've achieved something similar with a business rule, but these brings over all variables and removes the producer.comments.

Any help would be much appreciated.

Thanks!
Alex

6 REPLIES 6

Vasantharajan N
Giga Sage
Giga Sage

Do you want to display the actual variable question and answer below description field? like below find_real_file.png

 


Thanks & Regards,
Vasanth

Community Alums
Not applicable

Hi there,

I would like the variable question and answer to be in the incident description field.

Thanks!

Hi Alex,

So your description field should look like 

Question 1 : Answer 1

Question 2: Answer 2

Please confirm. 


Thanks & Regards,
Vasanth

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

use IF condition to check

if(producer.summary)
	current.short_description = producer.summary;

if(producer.comments)
	current.description = producer.comments;

If you are talking about showing the variables if those have value then use onLoad catalog client script which applies on Target Record

Check if value is present; if not then use setDisplay() to hide those.

regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader