
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2024 05:56 AM - edited 12-23-2024 07:00 AM
Hello, smart folks. What am I doing wrong here, please? ...
I created a notification which looks like this:
The associated Email script looks like this:
When I use the "Preview Notification" button, and supply the record number of an HR Benefits Case, everything seems to work fine, as you can see here:
But when the email is actually sent out, I don't get any data from the "comments_and_work_notes" field or the mail script, as you can see here:
How can the Preview work, but the actual email functionality Not work?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 12:19 PM
Found the answer with help from ServiceNow tech support...
There is a ServiceNow bug around the comments_and_work_notes field. It is documented in an existing knowledge article available here:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1587782
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2024 12:38 AM
Hi @G24
It seems that the script is executing correctly during the preview but not when the notification is triggered by a new work note.
The reason for this might be that the script is running before the new work note is fully committed to the database.
To solve this, we can add a slight delay before fetching the "comments_and_work_notes" to ensure that the new work note is saved. You can use // gs.sleep() // to introduce the delay.
Please don't forget to mark this as "Helpful" and press "Thumbs Up."

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2024 06:09 AM
Thanks, but that does not seem right to me, because there are already work notes present, and the field / script does not display those existing ones either. It seems like some kind of an ACL or Permissions thing to me, but I can't figure out what is getting blocked.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2024 04:07 PM
@G24 How are you triggering this notification, via an event or a record action?(insert/update) It seems that your notification is not getting associated with the HR Case record hence you are seeing the empty values in the notification.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2024 05:11 PM
Record Update.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2024 12:19 PM
Found the answer with help from ServiceNow tech support...
There is a ServiceNow bug around the comments_and_work_notes field. It is documented in an existing knowledge article available here:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1587782