The CreatorCon Call for Content is officially open! Get started here.

Additional comments(customer visible) copy to RITM

John Vo1
Tera Guru

Currently I have a BR called Work notes to RITM.   This will copy what was put in the task under work notes and pull that up to RITM.  

Here is the script:

find_real_file.png

What do I need to add to the script so additional comments (customer visible) gets copied up to RITM as well?

1 ACCEPTED SOLUTION

Hi John,



Not sure of already got the answer, got some time to do some testing as I promised and here is the test it did:



Type: Business Rule


Table: sc_task


Parameters: Run: Before insert and update


Filter Conditions: Additional comments or work notes changes


Script:


cascadeComment();


function cascadeComment(){


var gr=new GlideRecord("sc_req_item");


gr.get(current.request_item);



gr.work_notes=current.work_notes;


gr.comments=current.comments;


gr.update();


}



And I can see comments and work_notes are updated in activity formatter. Try this and see if this helps



Screen Shot 2017-07-23 at 10.11.23 PM.png



Screen Shot 2017-07-23 at 10.11.30 PM.png



Screen Shot 2017-07-23 at 10.11.44 PM.png



Screen Shot 2017-07-23 at 10.11.56 PM.png


View solution in original post

22 REPLIES 22

Yes I have a BR that does that but only for requested item.comments.   So when users update that additional comments it will copy it to the RITM.   But if you go to task and configure layout and just add additional comments and update it with notes it will NOT copy to RITM.   That's what I need to copy to RITM.


PriyaRanji
Tera Guru

Hi John Vo,



Good Day!



Do you want to update the additional comments in the task to the requested item?



If the above point is "Yes", then you can go with the below steps to update the same :



  1. 1.   Write the BR after/update (you can write it for task table)


  1. 2. conditon : current.comments.changes()


  1. 3. Please find the below script in BR to update the additional comments in the RITM


var gr = new GlideRecord('sc_req_item');


  1. gr.addQuery('sys_id','current.request_item);/*pass the sys_id of ritm*/
  2. gr.query();

if(gr.next()){


  1. gr.comments = current.comments;
  2. gr.update();

}



Hope this will help to update the value of the Additional Comments in the RITM.



PS: Your feedback (Like, Helpful or Correct) helps community!




Thanks,


Priyanka R


PriyaRanji
Tera Guru

Hi John Vo,



Good Day!



Do you want to update the additional comments in the task to the requested item?



If the above point is "Yes", then you can go with the below steps to update the same :



1.   Write the BR after/update (you can write it for task table)



2. conditon : current.comments.changes()



3. Please find the below script in BR to update the additional comments in the RITM



var gr = new GlideRecord('sc_req_item');


gr.addQuery('sys_id','current.request_item);/*pass the sys_id of ritm*/


gr.query();


if(gr.next()){


gr.comments = current.comments;/*update the additional comments in the RITM base on the task comments updated*/


gr.update();


}



Hope this will help to update the value of the Additional Comments in the RITM.



PS: Your feedback (Like, Helpful or Correct) helps community!




Thanks,


Priyanka R