9 views

How to set up email notifications to point to the Service Portal



Description


Out of Box email notifications is set up to direct users to records on the Platform UI. In some cases, you might want to have users go to the record on the Service Portal instead.

Procedure


1) Use an email notification script which would look something like the 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') + 'sp?id=ticket&table=' + current.sys_class_name + '&sys_id=' + current.sys_id + '">Link</a>';

  template.print(url);

})(current, template, email, email_action, event);

 

2) Once you have created the email script, you can then reference this in the email notification templates by using ${mail_script:name_of_email_notification_script}. Once you include this, it will show a "Link" hyperlink which will take you to the record on the SP.

Applicable Versions


All Supported

Additional Information


 

https://community.servicenow.com/community?id=community_question&sys_id=79d187a9db98dbc01dcaf3231f961933

https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/script/server_scripting/concept/c_UseJavaScriptInEmails.html

Article Information

Last Updated:2018-04-20 05:39:55
Published:2018-04-18