How to populate Short Description of Record Producer to Short Description of security Incident ?

Hritik
Tera Expert

Hello Community,

 

I have a simple query which I am not able to deal with.

 

My requirement is to populate the Short Description of Record Producer (which is created on table Security Incident) to Short Description of Security Incident. 

 

I wrote the below line of code (line no 1):

Hritik_0-1700470535645.png

 

 

Still it is not working 😞 

Please help me out here.

 

Thanks in Advance,

Hritik.

1 ACCEPTED SOLUTION

Hii @Hritik If you know the short description of the producer then you can store this value in variable as a static eg var abc = 'xyz';

then you can use the current.short_description = abc;

//Use code in record producer script.

 

View solution in original post

9 REPLIES 9

Akshata T
Tera Guru

@Hritik Do you need it for single record producer or multiple? And in which table you are submitting the record producer?

Hi @Akshata T 

I need it for multiple Record Producers. Record Producer is being submitted to Security Incident Table(sn_si_incident)

Hii @Hritik If you know the short description of the producer then you can store this value in variable as a static eg var abc = 'xyz';

then you can use the current.short_description = abc;

//Use code in record producer script.

 

Hritik
Tera Expert

Hi @Ankur Bawiskar 

 

Could you please help ?

 

Thanks in Advance,

Hritik.

@Hritik 

try this and it will work

var gr = new GlideRecord("sc_cat_item_producer");
gr.addQuery("sys_id", cat_item.sys_id);
gr.query();
if (gr.next()) {
	current.short_description = gr.getValue('short_description');
}

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

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