- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 12:48 PM
Dear All,
I'm trying to use below mention link in (var url1 = '<a href="' + gs.getProperty('instance_name')+'.service-now.com/'+'url' +'">Link</a>';) but it is not working in notification.
please let me know where I'm doing mistake.
var url='sn_grc_issue_list.do?sysparm_userpref_module=1c6662b30f1812004e938fbce1050999&sysparm_query=active%3Dtrue%5Eitem.sys_class_name%3Dsn_compliance_control%5EORitemISEMPTY%5Eassigned_toDYNAMIC90d1921e5f510100a9ad2572f2b477fe%5EORassigned_toDYNAMIC0f63961e5f510100a9ad2572f2b479998%5EORassignment_groupDYNAMICd6435e965f510100a9ad2572f2b47744%5EORitem.ownerDYNAMIC90d1921e5f510100a9ad2572f2b47776e%5Esys_class_name%21%3Dsn_vdr_risk_asmt_issue%5EEQ';
template.print(url1);
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 01:13 PM
Hi, when you state 'it is not working' what is your actual diagnosis?
Have you created this as a notification email script and called it from your notification?
What is populated into the body of your sent email, do you see the word 'Link' ?
- you must enable email sending as notification email scripts run when a message is sent, not when the message is populated into the outbox.
Assuming you see the 'Link' in your notification, what is wrong with the actual redirect\url?
Looking at your code you have 'url' in quotes meaning that it is a string, not a reference to your string named url, perhaps try
var url1 = '<a href="' + gs.getProperty('instance_name')+ '.service-now.com/' + url + '">Link</a>';
Notification Email Scripts | ServiceNow Developers
Scripting for email notifications (servicenow.com)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2022 01:13 PM
Hi, when you state 'it is not working' what is your actual diagnosis?
Have you created this as a notification email script and called it from your notification?
What is populated into the body of your sent email, do you see the word 'Link' ?
- you must enable email sending as notification email scripts run when a message is sent, not when the message is populated into the outbox.
Assuming you see the 'Link' in your notification, what is wrong with the actual redirect\url?
Looking at your code you have 'url' in quotes meaning that it is a string, not a reference to your string named url, perhaps try
var url1 = '<a href="' + gs.getProperty('instance_name')+ '.service-now.com/' + url + '">Link</a>';
Notification Email Scripts | ServiceNow Developers
Scripting for email notifications (servicenow.com)