Notification, how to take last comment or work note
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-20-2017 10:47 AM
My requirement is to take last comment or work note ,which one last updated either additional comment or worknotes . how to do that.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-18-2018 01:43 PM
var workNotes = current.work_notes.getJournalEntry(1);
var comment = current.comments.getJournalEntry(1);
if(comment > workNotes){
template.print(comment.replace(dateRE, ''));
}
else{
template.print(workNotes.replace(dateRE, ''));
}
The Journal Entry leads with a date/time. This compares the beginning date and time and outputs whichever is the newest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2020 09:47 PM
Hi,
I need help on one of the scenarios:
1. When the "caller" sends reply to the email then the "Additional comments" should be updated on the Incident
2. When the "assigned_to" is replying then the "work-notes" should be updated
In the above 2 scenarios i tried the below code:
if (email.from == current.caller_id.email){
gr.comments = email.body_text;
}
if (email.from == current.assigned_to.email)
{
gr.work_notes = email.body_text;
}
However the additional comments gets updated with email body text with the fact that it updates the entire email chain. Is there a way that I can update work notes or comments with latest email reply content? For example : if I have
Body :
"Test 4
from:xyz
date: abcabcabc
to:aghgh
...
..
Test 3
"
I would like to update the notes or comments with "Test 4" accordingly