How to insert close notes in a notification

redth
Giga Expert

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

1 ACCEPTED SOLUTION

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


  }


}


View solution in original post

19 REPLIES 19

I have tried as you mentioned. It's not working


Did you try dotwalking to the task table field ?


Chuck Tomasi
Tera Patron

I think part of the confusion is what you are referring to the "task" table. Are you talking about the Task [task] table or the SC Task [sc_task] table?



I need to insert close notes (present in the task table) in the notification which was built on requested item table.

I'm trying to create a notification on sc_requested_item table with the field present in catalog task


What table is the notification set to run with? If it's the Catalog Task (sc_task) table, then you can dot-walk to your close notes on the parent request item like this:



${requested_item.close_notes}



If your notification is on Requested Item (sc_req_item), that's going to be a bit of a trick since there may be multiple tasks associated with the req item.



Can you show me a screen shot of the top of that notification form also?