- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2015 10:53 PM
I am sending an email notification when incident is commented.
No big deal, right ?
In the comment field, I typed a, then hit Enter, typed b, then hit Enter, typed c, then hit Enter.
The notification has ${comments} in it.
This works great, but the sys_created_by and sys_created_on are added. We do not want these two fields.
So I wrote a mail script to strip off the timestamp and user name, but now the comments are put into a string that I can not figure out how to force a line break after each comment.
this is what my script produces, removing the sys_created fields, but loses the line breaks.
Any ideas ?????
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2015 12:48 PM
This is now working, thanks to you and your assistance !
Header is being stripped and comments in notification are in "list format".
The final thing I had to do was check the Newlines to HTML box.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2015 12:31 AM
Try
var notes = current.comments.getJournalEntry(-1);
var na = notes.split("\n\n");
for (var i = 0; i < na.length; i++)
{
var subNotes = na[i].split("\n");
for (var j = 1; j < subNotes.length; j++)
{
template.print(subNotes[j].toString());
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2015 10:35 AM
Deeply appreciate your time and your script.
The script worked beautifully stripping out the "header" = Customer Visible Comments
Thank you.
Unfortunately, the comments are not is a list format in the Notification as they are in the Comment field.
That continues to be my challenge.
comment field
and same comments in the notification

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2015 10:20 PM
Can you add a '\n'?
template.print(subNotes[j].toString()+'\n');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2015 12:48 PM