- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2022 04:19 AM
Hello
I am working on mail script. I found the ${URI_REF} will link the ticket to legacy view only but we would like to promote more usage to Workspace, so we need to create the mail script that will show the ticket number and after we click the link it will go to the Workspace instead.
Sample
Now when click the ticket link which is from ${URI_REF}, it will go to
https://abc.service-now.com/nav_to.do?uri=%2Fx_alite_us_treas_0_us_treasury_request.do%3Fsys_id%3D2c1ce2f187c99550a62420e5cebb35a6%26sysparm_stack%3Dx_alite_us_treas_0_us_treasury_request_list.do%3Fsysparm_query%3Dactive%3Dtrue
but I need it to re-direct to
https://abc.service-now.com/x/alite/treasury/record/x_alite_us_treas_0_us_treasury_request/2c1ce2f187c99550a62420e5cebb35a6
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2022 05:53 AM
var agentURL = '<a href="' + gs.getProperty('glide.servlet.uri') + '/x/alite/treasury/record/'+ current.getTableName() + '/' + current.sys_id + '">' + 'Click Here'+ '</a>';
template.print(agentURL + "<br />");
Mark this correct if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2022 04:24 AM
hello
you can write you email script like this
var link= '<a href="https://abc.service-now.com/x/alite/treasury/record/x_alite_us_treas_0_us_treasury_request/"'+current.sys_id+'>'+'click here'+'</a>'
template.print(link);
and call your email script in notification like below
${mail_script:your_mail_script_name}
please mark my answer correct if it helps you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2022 04:48 AM
HI Mohith
I tried but it doesn't get the sysid.
Here's the result after click on the link
https://abc.service-now.com/x/alite/treasury/record/x_alite_us_treas_0_us_treasury_request/
but we should get this result instead: https://abc.service-now.com/x/alite/treasury/record/x_alite_us_treas_0_us_treasury_request/2c1ce2f187c99550a62420e5cebb35a6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2022 04:49 AM
this is script
(function runMailScript(current, template, email, email_action, event) {
var link = '<a href="https://abc.service-now.com/x/alite/treasury/record/x_alite_us_treas_0_us_treasury_request/"'+current.sys_id+'>'+'click here'+'</a>';
template.print(link);
})(current, template, email, email_action, event);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2022 04:56 AM
hello
which table is the notification configured on ?
i am assuming its on x_alite_us_treas_0_us_treasury_request this table ?