I am calling a mail script from notifications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 11:17 AM
I am calling a mail script from notifications
here is my code

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 11:27 AM
If memory serves you can just add ${comments} to the notification body and it will automatically include the last three.
But for your script you need to use template.print() and not a return value.
So replace
var latestComment =gr.comments.getJournalEntry(1);
with
template.print(gr.comments.getJournalEntry(1));
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 11:29 AM - edited 04-23-2024 12:18 PM
Hi @kiran kumar m1 ,
If you want your mail_script to show the comments and your notification is on incident table only then you can use the below single line code
template.print('<p><font size="3" color="#808080" face="helvetica">' + gs.getMessage('${comments}') + '</font></p>');
Please mark this comment as Correct Answer/Helpful if it helped you.
Regards,
Swathi Sarang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 11:37 AM
hii @swathisarang98 if it is a custom table then ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 12:02 PM
Hii @swathisarang98 I have tried your code but its giving me output in this way . I am getting random numbers under the comments