To bring task number link in email body of parent notification .

Servicenow12
Tera Contributor

To bring task number link in email body of parent notification .

Notification on parent table should be like :

TASKXXXXX(On clicking should navigate to this task) has been created for this ticket . Kindly approve.

 

I wrote below mail script and tried using this mail script [  ${mail_script:sms_task_number}  ] in body of notification but its not working . Please tell whats wrong 

 

var gr = new GlideRecord('x_child_task');
gr.addQuery('parent', current.sys_id);
gr.addQuery('task',"Review for SMS ");
gr.query();
if (gr.next()) {

email.setBody(gr.number);
}

1 REPLY 1

Michael Jones -
Giga Sage

Try something like this, assuming your query is otherwise correct (I can't test that obviously). 

var gr = new GlideRecord('x_child_task');
gr.addQuery('parent', current.sys_id);
gr.addQuery('task',"Review for SMS ");
gr.query();
if (gr.next()) {

template.print('<a href="https://' + gs.getProperty('instance_name')+ '.service-now.com/'+ gr.getLink() + '">' + gr.number + '</a> has been created for this ticket. Kindly approve.');
}

I hope this helps!

If this was helpful, or correct, please be kind and mark the answer appropriately.

Michael Jones - Proud member of the GlideFast Consulting Team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!