Sync Approval Record Comments to sc_task Comments

anshul_goyal
Kilo Sage

How can I populate the Comments field on the sc_task record with comments from related approval records in ServiceNow?

Thanks

1 ACCEPTED SOLUTION

pawank2
Tera Expert

Hi Anshul,

use after update BR on approval table and past this code in advance section.

 

var gr = new GlideRecord(current.source_table); 
gr.addQuery("sys_id", current.document_id); 
gr.query();       
 if (gr.next()) {             
gr.comments = current.comments.getJournalEntry(1);                
gr.update();    
 }

My Solution is helpful and accepted.

 

 

View solution in original post

1 REPLY 1

pawank2
Tera Expert

Hi Anshul,

use after update BR on approval table and past this code in advance section.

 

var gr = new GlideRecord(current.source_table); 
gr.addQuery("sys_id", current.document_id); 
gr.query();       
 if (gr.next()) {             
gr.comments = current.comments.getJournalEntry(1);                
gr.update();    
 }

My Solution is helpful and accepted.