- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2020 03:52 AM
I have created email notification on RITM table i need 3 links on the same notification , 1 is for RITM number and other 2 for sc_task ,
I am using below for RITM number link .but how can i achieve the same for Catalog Task no. on same notification
${URI_REF}
Thanks and advanced.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2020 03:57 AM
Hi,
for that you need to use mail script
Create new mail script and add it to notification
I assume your email notification is on RITM table
How to call in Notification: ${mail_script:show_sc_task_link}
Name: show_sc_task_link
Mail Script:
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var taskRec = new GlideRecord('sc_task');
taskRec.addQuery('request_item', current.sys_id);
taskRec.query();
while(taskRec.next()){
var url = '<a href="' + gs.getProperty('glide.servlet.uri') + '/nav_to.do?uri=' + taskRec.getTableName() + '.do?sys_id=' + taskRec.sys_id + '">' + taskRec.getDisplayValue() + '</a>';
template.print(url);
}
})(current, template, email, email_action, event);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2020 05:28 AM
i changed the query filter now its working fine
mail script:
var Rec = new GlideRecord('u_entries');
Rec.addQuery('u_source', current.sys_id);
gs.log('number of entries'+current.u_number);
Rec.query();
while(Rec.next()){
//template.print(Rec.number);
var url = '<a href="' + gs.getProperty('glide.servlet.uri') + '/nav_to.do?uri=' + 'u_entries' + '.do?sys_id=' + Rec.sys_id + '">' + Rec.getDisplayValue() + '</a>'+'<br>';
template.print(url);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2020 05:36 AM
Glad to know
That's what I mentioned the query is not working because of field type
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2021 05:40 AM
Hi Ankur,
May I know what is inside below sys property:
('glide.servlet.uri')
Thanks in advance