Copy work notes from the work order task to the work order and then to the Incident

i_sachin_
Tera Contributor

Hi ServiceNow Community,

We are mapping fields from incident to work order and work order task, which includes work notes, using business rules. We have been able to accomplish this task successfully. However, when the technician adds any work notes in the work order task form, it should be reflected in the incident table's work notes field. Unfortunately, I have not been able to achieve this. 

1 REPLY 1

Sanuja Kulkarni
Mega Guru

Hello @i_sachin_ ,

 

Please write a before business rule on Incident Task table 

(function executeRule(current, previous /*null when async*/) 
{
    var inc = new GlideRecord('incident');
    inc.addQuery('sys_id', current.incident);
    inc.query();
    if(inc.next())
   {
       inc.work_notes = "Worknotes from " + current.number +':'+"\n\n" + current.work_notes;
       inc.update();
   }
})(current, previous);

SanujaKulkarni_0-1709553213237.png