The CreatorCon Call for Content is officially open! Get started here.

'Comments' in email notification

Riya17
Giga Contributor

Hi,

I have a requirement to show 'comments' in the request rejection email notification.  At the moment the script is not working.  It just shows blank space for 'Comments'.  Below is my notification, template and the script.   Could someone help me where it's going wrong.

Thank you 

 

Notification:

 

find_real_file.png

 

Template:

find_real_file.png

email script:

var comment = new GlideRecord("sysapproval_approver");
comment.addQuery("sysapproval", current.sys_id);
comment.query();
while (comment.next()) {
var comments = rec.comments.getJournalEntry(1);
template.print("<b>Comments:</b>" + comments + "\n");
template.print("<b>Comments:</b>" + comments.substring(comments.indexOf("\n")+1) + "\n");
}

 

 

15 REPLIES 15

Riya17
Giga Contributor

I've tried that too with no luck.  How strange it worked for others in the above thread and doesn't work for me:-(