Need to populate record producer name in the Incident short description

ab
Tera Contributor

I have a requirement to populate the name of the record producer in the Incident's short description when the incident got created from that record producer.

1 ACCEPTED SOLUTION

Vasantharajan N
Giga Sage
Giga Sage

Please use the below code 

current.short_description = "Catalogue Name : "+cat_item.name;


Thanks & Regards,
Vasanth

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can use this in record producer script

current.short_description = 'Your Name of Record Producer'; // you need to hard-code it

Regards
Ankur

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

I have almost 150 record producers, So need a script instead of hard coding

Hi,

then you can use after insert BR on each of the target table. This you will have to do for all target tables

no short cut for this

this table "sc_item_produced_record" holds data when record is generated from record producer

var gr = new GlideRecord("sc_item_produced_record");
gr.addQuery("task", current.sys_id);
gr.query();
if (gr.next()) {
	current.short_description = gr.producer.name;
	current.update();
}

regards
Ankur

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

@ab

Thank you for marking my response as helpful.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

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