Help needed with journal field comments in an email notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2018 12:56 AM
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.
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2018 02:07 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2018 04:07 AM
Hi Ankur,
Date and name are still getting displayed in the email notification.
Any other suggestions?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2018 05:40 AM
Hi Lk,
The same script is working fine for me. Can you share your script.
Screenshot below:
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2018 05:56 AM