Copy Additional Comments from Request to RITM

TStark
Kilo Sage

Can anyone provide some insight on the proper script for the Business Rule that will allow Additional Comments created on the Request to automatically copy to the RITM? I tried using the following with no luck.

Create an after business rule on sc_request table

-When: after insert and update
-Conditions: Additional comments changes
-Script:

var gr= new GlideRecord("sc_req_item");


gr.get(current.getValue("request_item"));


gr.comments=current.comments.getJournalEntry(1);


gr.update();

Thanks,
AJ

1 ACCEPTED SOLUTION

Saurav11
Kilo Patron
Kilo Patron

Hello

var gr = new GlideRecord('sc_req_item'); gr.addQuery('request',current.sys_id);

gr.query(); while(gr.next())

{

gr.comments = current.comments;

gr.work_notes = current.work_notes;

gr.update();

}

Please mark answer correct/helpful based on impact

View solution in original post

17 REPLIES 17

I assume that based on the Filter Conditions the BR should run whenever Additional Comments change on the Req. Not sure how to verify based on inbound emailed comments.

Thanks,
AJ

try to process some inbound email and check if BR runs.

Ideally it should trigger when comments changes

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

I checked the Email Log on the test email I sent for additional comments and their are no mentions of a Business Rule in the log of the specific email in question.

Thanks,
AJ

Ideally the BR should trigger when comments changes be it from UI or from inbound action

When inbound email is received did you verify comments got changed?

you can verify that by checking the history of the record and check the timing of inbound email

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Yes the Additional Comments were added to the Request when an email was sent/replied to the email associated with the open Request.

AJ