Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

Sync Approval Record Comments to sc_task Comments

anshul_goyal
Mega 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.