- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2022 07:27 AM
Hello,
I need help. I am working on mail script to send notification email to end user to route to the ticket on service portal (not Platform UI). I used below script, it works well to go to the ticket on service portal but the hyperlink name now is 'Link' , anyone has the idea how to get the ticket number on the hyperlink instead of 'Link' (ie. RITM00012334 as hyperlink)
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var url = '<a href="' + gs.getProperty('glide.servlet.uri') + 'esc?id=ticket&table=' + current.sys_class_name + '&sys_id=' + current.sys_id + '">Link</a>';
template.print(url);
})(current, template, email, email_action, event);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2022 07:43 AM
@Bird1 my bad did not give the correct script try this
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var url = '<a href="' + gs.getProperty('glide.servlet.uri') + 'esc?id=ticket&table=' + current.sys_class_name + '&sys_id=' + current.sys_id + '">'+current.number+'</a>';
template.print(url);
})(current, template, email, email_action, event);
Can you please try the above script ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2022 07:32 AM - edited 11-14-2022 07:32 AM
@Bird1 Try to use this script and let me know
use current.number instead of Link text like below
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var url = '<a href="' + gs.getProperty('glide.servlet.uri') + 'esc?id=ticket&table=' + current.sys_class_name + '&sys_id=' + current.sys_id + '">current.number</a>';
template.print(url);
})(current, template, email, email_action, event);
Hope this helps
Mark the answer correct if this helps you
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2022 07:36 AM - edited 11-14-2022 07:37 AM
Thanks, but it returns with the wording 'current.number' as hyperlink instead of actual ticket number.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2022 07:43 AM
@Bird1 my bad did not give the correct script try this
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var url = '<a href="' + gs.getProperty('glide.servlet.uri') + 'esc?id=ticket&table=' + current.sys_class_name + '&sys_id=' + current.sys_id + '">'+current.number+'</a>';
template.print(url);
})(current, template, email, email_action, event);
Can you please try the above script ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-14-2022 07:51 AM
Thanks a lot., it's workable.