- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 10-28-2020 11:05 PM
One of the requirement I was working on in Servicenow was to generate a notification when an RITM is commented. The issue was as follows:
When user enters multi-line comment on RITM for example:
"This is a test
This comment is on line 2"
I used an email script to add notification as:
template.print(current.comments.getJournalEntry(1))
This statement gives the latest comment on an RITM.
On my notification, this comment above was displayed as:
template.print('<div><font color="#4d148c" face="Segoe UI">' + notes[i] + '</font></div>');
}
- 2,468 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Varun
can we exclude this line"2020-10-28 20:42:16 PDT - System Administrator (Additional comments)" from comments ?
Thanks and Regards
Ramu k
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I don't think so.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Ramu,
you can skip the first line in the for loop.
alternatively, you can change the font color as well. so that it will be hidden.
template.print('<div style="color: #FFF;">' + notes[0] + "</div>");
template.print('<strong><div style="color: darkorange;">');
for(var i=1;i<notes.length;i++){
template.print(notes[i]);
}
Regards
S Rajkumar