How to get latest comment from Comments and request comment fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2023 09:16 AM
I have a requirement to get latest comment from comments and request comment in email script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2023 10:01 AM - edited 05-10-2023 11:41 AM
Hi @Hareesha ,
You can use below lines in mail script to get latest comment and request comment
var workNote = current.work_notes.getJournalEntry(1);
var requestComment = current.comments.getJournalEntry(1);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2023 08:48 PM
Hi @Manmohan K
My requirement is i need either the worknote or request comment which is last updated . Is it possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2023 10:39 AM
Hi @Hareesha,
Please use the following email script to fetch the latest comments
(function runMailScript(current, template, email, email_action, event) {
var comment = current.comments.getJournalEntry(1).match(/\n.*/gm).join('').replace(/^\s*\n/gm, "");
template.print(comment);
})(current, template, email, email_action, event);
If my answer has helped with your question, please mark it as correct and helpful
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2023 08:49 PM
My requirement is i need either the work note or request comment which is last updated . Is it possible?