How to pull catalog task fields in email script for REQUEST notification

Nisha30
Kilo Sage

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);

}

--------------------------------------------------------------------------

3 REPLIES 3

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

Your script seems fine , maybe you are just not using it right

Check this thread 

Showing SCTASK numbers with an email - ServiceNow Community

-Anurag

Hi @Anurag Tripathi 

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

Sandeep Rajput
Tera Patron
Tera Patron

@Nisha30 Can you check if you have any catalog task associated with the given request?