Email script is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 04:37 AM
Hello team,
The below script is not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 04:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 04:45 AM
Hi Anil
Are you trying to build an URL on a notification to navigate to any RITM record by using email script? Please confirm
Thanks
Sai Vijitha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 05:12 AM
Hi everyone, thanks for the response.
My requirement is
I build a new catalog item—"Request a Device."
variable
ritm_number
device name
The onboarding workflow sends a notification to the manager with the link.
If the manager clicks the link via email, it redirects to the portal, and the variable ritm_number will auto-populate with the onboarding ritm number.
Email script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2025 05:19 AM
Hi @AnilM99 fix your email as below:
(function runMailScript(current, template, email, email_action, event) {
var sysId = '73b1bafa9752cd1021983d1e6253afb5'; // Catalog item sys_id
var ritmNumber = current.sys_id; // The current RITM sys_id
var baseUrl = gs.getProperty('glide.servlet.uri'); // Gets your instance base URL
var link = baseUrl + 'sp?id=sc_cat_item&sys_id=' + sysId +
'&sysparm_variables=' + encodeURIComponent(JSON.stringify({ritm_number: ritmNumber}));
template.print('<a title="Please click here to submit new device request." href="' + link + '">Please click here to submit new device request.</a>');
})(current, template, email, email_action, event);