How to Add email body to the comments or work notes in ServiceNow

Arun91
Tera Contributor

Hi,

I have a requirement to copy the body of the email to work notes or comments in ServiceNow. How to achieve this.

7 REPLIES 7

Abhijeet_Pawar
Tera Guru

Hello @Arun91,

If you're receiving emails through an inbound email action, you can use the following script in the Action tab of the inbound action form:

var gr = new GlideRecord('table_name');
gr.work_notes = email.body;
gr.update();


This will update the work notes with the email body content.

Let me know if you need further clarification.

Thank you.

Ankur Bawiskar
Tera Patron
Tera Patron

@Arun91 

which email? the email received on the record via inbound?

what's your business requirement?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Update Approval Request is the name of the inbound action. I am calling event in this inbound email action that trigger email notification. Now i want to capture body of the email content to the comments of sysapproval table

@Arun91 

so email is received and inside your inbound action you want to write code to show that email received in comments of approval table

This happens OOB

You are sending another email via that inbound what do you want in that? the email received body to be added in the new email triggered?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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