How to pull catalog task fields in email script for REQUEST notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 08:32 AM
Hello Experts,
I want to include Catalog Task fields to be included in Notification - in REQUEST table.
mail script is not giving any data sure something is wrong. Notification triggered is not displaying any of the field.
Can anyone suggest how to display and bring those fields in here.
-------------------------------
//NOTIFICATION TABLE = sc_request
//MAIL SCRIPT
var ctask = new GlideRecord("sc_task");
ctask.addQuery("request", current.sys_id);
ctask.query();
while (ctask.next())
{
template.print(ctask.short_description + "from" + ctask.number);
}
--------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 08:38 AM
Hi,
Your script seems fine , maybe you are just not using it right
Check this thread
Showing SCTASK numbers with an email - ServiceNow Community
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2024 01:41 AM
went through the post thanks. My code is similar it seems and what i noticed is i can get the logs with proper sc_task but when i preview the email i cant see.
not sure if originally the email will contain this based on the logs what i get successfully in logs now.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2024 08:43 AM
@Nisha30 Can you check if you have any catalog task associated with the given request?