incident short description updation

Srvs
Kilo Guru

Hello All,

i need to update the incident short description like "incident number+ caller+ is updated this incident." using script include,

to achieve this functionality i wrote a script include like below, and i called that SI inside the Business rule but i dont know how to receive the data from script to business rule,

please help me.

Script include:

MyMethod:function(){
var details=new GlideRecord('incident');
details.addQuery('active',true);
details.addQuery('sys_id', current.SysID);
details.query();
while (details.next()){
return number+' '+ caller_id+ ' '+"is updated this incident.";

Business rule:

var dtls=new SIncludeBRcall().MyMethod();

 

Here i dont know how to update that data into short description.

 

Regards,

Venkat.

5 REPLIES 5

Rohit Kaintura
Mega Guru

You can simply update the short description by using current if business rule table and target table are same or do a gliderecord if the table is another one. No need to use script include.

i am not getting your answer.

write a BR on incident table:

current.short_description= current.number+' '+caller_id+'is updated this incident';

Gurpreet07
Mega Sage

one additional line of code in BR   (considering that its a before business rule)

var dtls=new SIncludeBRcall().MyMethod();

current.short_description = dtls ;