Is it possible to customise a clickable link in a notification

RichardSaunders
Tera Guru

Are ${URI} & ${URI_REF} the only options to link through to a record. How would i configure something like "please click 'here' for approval". With 'here' linking to the relevant Change record.

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Hi Richard,



You can do this. It requires a minimal amount of script.



You should find this reference helpful:


Scripting for Email Notifications - ServiceNow Wiki



Please note, that you do not need to construct a full path URL (which is handy when testing in dev and deploying to production.) The system is smart enough to recognize relative URLs and translate them in to full URLs in the final message. For example, a link like:



<a href="/incident.do?sys_id=ad102230db1222002e38711ebf96190b">Click here to open the incident</a>



Will get the https://instancename.service-now.com added to the front of it automatically.


http://wiki.servicenow.com/index.php?title=Email_Notifications


View solution in original post

7 REPLIES 7

Deepa Srivastav
Kilo Sage

Yes its possible, check my reply in the below thread.



Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.



how to set the link to a particular record by using email notifications?


Chuck Tomasi
Tera Patron

Hi Richard,



You can do this. It requires a minimal amount of script.



You should find this reference helpful:


Scripting for Email Notifications - ServiceNow Wiki



Please note, that you do not need to construct a full path URL (which is handy when testing in dev and deploying to production.) The system is smart enough to recognize relative URLs and translate them in to full URLs in the final message. For example, a link like:



<a href="/incident.do?sys_id=ad102230db1222002e38711ebf96190b">Click here to open the incident</a>



Will get the https://instancename.service-now.com added to the front of it automatically.


http://wiki.servicenow.com/index.php?title=Email_Notifications


Thanks, but wont that link to a specific sys_id? I would like it to direct to the sys_id of the current record.


You can reference the current record in your script, ie:



template.print('<a href="https://' + gs.getProperty('instance_name') + '.service-now.com/nav_to.do?uri=incident.do?sys_id=' + current.sys_id + '">' + current.short_description + '</a>');