How to create a link in a workflow notification

Community Alums
Not applicable

Hi ,

 

I am trying to create a link in a workflow notification, for this I have tried the below email script in Workflow notification but it did not work.

<mail_script>

var gr = new GlideRecord('u_request_item');

gr.addQuery('sys_id',current.u_document_id);
gr.query();
if(gr.next())

{

template.print("Request ID : " +<a href="myinstance.service-now/nav_to.do?uri=u_request_item.do?sys_id=${gr.sys_id}">${gr.number}</a> +'\n');

}

</mail_script>

If it is wrong, help me with it.

1 ACCEPTED SOLUTION

Your quotations (") are all messaged up in your template.print line. Try fixing that and it should be good. I recommend putting your script in a script editor (script field) so you can see any syntax errors.

View solution in original post

5 REPLIES 5

Your quotations (") are all messaged up in your template.print line. Try fixing that and it should be good. I recommend putting your script in a script editor (script field) so you can see any syntax errors.