- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
try this and see if this works
add this in Message field
Latest comments is: ${comments:1}
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday - last edited yesterday
how it looks currently? share screenshots
share the config where you did that, if somewhere script can be used
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @PaulaaO ,
1) first create the email script :
create new record
2)now in you notification :
add this code :
${mail_script:your_script_name}
save the notification record . and click on preview Notification to test. select preview record to test notifiaction . you can your record latest worknot in notification email
copy this code un your email script as it is :
(function runMailScript(current, template, email, email_action, event) {
var workNotes = [];
var gr = new GlideRecord('sys_journal_field');
gr.addQuery('element_id', current.sys_id);
gr.addQuery('element', 'work_notes');
gr.orderByDesc('sys_created_on');
gr.setLimit(1);
gr.query();
if (gr.next()) {
template.print(gr.value);
} else {
template.print('No work notes found');
}
})(current, template, email, email_action, event);
If my response helped resolve your issue, please mark it as Helpful and Accept it as the Solution — it helps others in the community find answers faster!
Thanks...!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Thank you very much for the detailed step by step, however I needed to make this work as a Bell notification (provider notification type), not an email one, but will definitely keep this one in mind for when I'll have to work with email notifications. Thanks 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @PaulaaO ,
Perhaps the best approach is to display a message like "New comment on Case" on the provider notification content, which, when clicked, opens the case so the user can view it in the activities tab.
Alternatively, save the latest comments in a new field and reference them in the message.
Regards,
Sarah Bioni
