Change text of \${URI} from LINK

Mike Malcangio
ServiceNow Employee
ServiceNow Employee

In our e-mail messages we would like to change the text of the URLs to something other than LINK when using ${URI} (for the technician's to link to their case, users their request in the app, etc.). Does anyone know of a way to do this?

We experimented with a mail script that looked this ...


var thisID = ${sys_id};
var thisHost = gs.getProperty('glide.proxy.host');
var hostParameters = "nav_to.do?uri=incident.do?sysparm_view=ess&sysparm_stack=incident_list.do&sysparm_query=active=true&sys_id=";
template.print("clicking here.");


Unfortunately, it worked for a spell and then quite working.

Any suggestions would be greatly appreciated for how to work around this one.

--Mike

1 ACCEPTED SOLUTION

Not applicable

Mike, try using:

var thisID = current.sys_id
instead of:

var thisID = ${sys_id};
I think that might do the job!


View solution in original post

11 REPLIES 11

The script is not working it is not filling out the variable thisHost

Any thoughts?


Try this.


<mail_script>
var thisID = current.sys_id;
var thisHost = gs.getProperty("glide.servlet.uri");
var hostParameters = "nav_to.do?uri=incident.do?sys_id=" + thisID;
template.print("<A HREF=" + thisHost + hostParameters + ">clicking here.</A>");
</mail_script>


works like a charm.


I would suggest the following from the template.

Click to View">http://www.service-now.com/altera/nav_to.do?uri=incident.do?sys_id=${sys_id}&sysparm_stack=inc...

This will put the incident, problem, etc. number in as part of the link. The syntax would be slightly different for the notification. This one works in the template. Use the parm value in the notification.

The development of this was a colaborative effort. Jerrod and I worked on a similar one for the KB 8-10 months ago. Christen helpd me adapt to a template.

Bill Collins, Altera Corporation