Help needed with journal field comments in an email notification.

LK11
Mega Expert

Hi,

I'm trying to display the latest comments from a request in an email notification.  Below is my email script.

var comments = current.comments.getJournalEntry(1);
template.print (comments);

Below is the screenshot of how the comments are displayed in the email.

find_real_file.png

How can I get rid of the date, name and I don't know where  (Comments) is coming from which I don't want either.  If anyone had this issue before, please let me know how you resolved it.

 

Many thanks

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Lk,

For this you will have to do string manipulation and get the content.

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

var na = comments.split("\n");

var finalValue = na[1];

template.print (comments);

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Hi Ankur,

 

Date and name are still getting displayed in the email notification.

 

Any other suggestions?

 

Thanks

Hi Lk,

The same script is working fine for me. Can you share your script.

Screenshot below:

find_real_file.png

Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

 

Below is the script which you suggested.  The date and name are still getting displayed.

 

find_real_file.png