To bring task number link in email body of parent notification .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2022 04:44 AM
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);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2022 08:53 PM
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!
Michael D. Jones
Proud member of the GlideFast Consulting Team!