How to add a hyper-link to a workflow email notification?

tobrien
Kilo Guru

Hi,

I would like to do something like this ==>

Link to final task: <a href="https://my.service-now.com/sc_task.do?" + {taskid} + >Click Here </a>

This output is part of a NOTIFICATION module in my workflow (in blue below).

I am of the understanding that html can be simply added to my "message" body.

But in my case I would like to add the TASKID of the task that was closed "just before" as you can see below. So I think I have 2 questions:

1. What is the syntax for generating a link without a hard-coded TASKID.

2. How do I get that TASK ID?

Thanks!

tony

Screen Shot 2017-01-06 at 2.44.02 PM.png

1 ACCEPTED SOLUTION

Srinivas Balusu
Kilo Guru

I hope you should be able to do that with eMail scripts.



Scripting for Email Notifications - ServiceNow Wiki


View solution in original post

4 REPLIES 4

Srinivas Balusu
Kilo Guru

I hope you should be able to do that with eMail scripts.



Scripting for Email Notifications - ServiceNow Wiki


Thanks, bsss,



I agree that template/scripting helps the overall goal, but how do I get the SYS_IDs of (any of) the CATALOG TASKS associated with this workflow?


Thanks to all...   I think I can get what I am after with a combination of the MAIL SCRIPT notion combined with the script contents based upon this example:



var instanceName = gs.getProperty('instance_name', null);


var link = 'https://' + instanceName + '.service-now.com/nav_to.do?uri=certification_list.do?sysparm_query=active=true^assigned_to=javascript:getMyAssignments()^EQ';




var title = "Click here to access your certification records";


var anchor = "<a href='" + link +"'>" + title + "</a>";


      template.print(anchor + "\n");


saha_namrata92
Tera Contributor

Hi Team,

There is a similar requirement like this, but the only added one is instead of single hyperlink in the WF notification, I need to add multiple hyperlinks in comma separated form in the email body which is stored in the WF scratchpad array list.

For E.g., TEST1, TEST2, TEST3... TESTN 

Could you please suggest , how can this be achieved?