- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2016 10:09 AM
Hello,
I need to insert close notes (present in the task table) in the notification which was built on requested item table.
Can you let me know how to achieve this?
Best,
Akshitha
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-06-2016 03:30 PM
Thanks for the clarification. In your message HTML include this:
Close notes: ${mail_script:task_close_notes}
Navigate to System Notification> Email> Notification Email Scripts and create a new record with the name: task_close_notes.
For the script: use this
var scTask = new GlideRecord('sc_task');
scTask.addQuery('request_item',current.getValue('sys_id'));
scTask.query();
if (scTask.next()) {
if (scTask.closed_notes != "") {
template.print(scTask.getValue('closed_notes');
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2016 10:28 AM
Hi Akshita,
In your notification, you can use the meta string ${field_name} to get the value of the field from the record related to the notification. If I understand your question properly, you need to add this to your notification:
Close notes
${u_close_notes}
Scripting for Email Notifications - ServiceNow Wiki
Email Notifications - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2016 10:36 AM
Hello Chuck,
I have tried this already. But, it's not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2016 10:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2016 02:34 PM
Yes Chuck, I have selected the variable from the right side of message text window. Still it's not working