Adding hyperlink work note to RITM via workflow

vw1
Giga Contributor

Hi,

 

I have added a script below to add Work Notes to RITMs. 

var comment = 'Please follow the instructions on Connect: https://community.servicenow.com';
		
var req = new GlideRecord('sc_req_item');
req.addQuery('sys_id', ritmSysId);
req.query();
while(req.next()){
	req.comments = (comment);
	req.update();
}

This code resulted in a comment that shows hyperlink in Service Portal, but not in "Comment Added" email notification.

I have then tried the below script:

...
	req.comments = ('[code]<a href="https://connect.fg.rbc.com/docs/DOC-111720">' + linkName + '</a>[/code]');
	req.update();
...

Which then resulted in a hyperlink in "Comment Added" email notification, and a raw code line (e.g. [code]..[/code]) in Service Portal's RITM Ticket form.

 -> Similar to the screenshot: find_real_file.png 

 

Would like to know if there is a way to display a hyperlink properly in both Service Portal and ServiceNow view of the RITM?

1 ACCEPTED SOLUTION

Harish KM
Kilo Patron

This code works for me both in Portal and console view. Used BR

current.work_notes =' [code]<a href="https://www.servicenow.com">ServiceNow.com</a>[/code]';

find_real_file.png

Regards
Harish

View solution in original post

6 REPLIES 6

Haikz1
Kilo Expert

There is more information here: Formatting within Journal fields using HTML & [code]

 

ServiceNerd
Tera Guru
In this follow on vid from sync of work notes between Request Item and Catalog task we look at embedded hyperlinks in work notes..you can do it on additional comments too! or to give it a better name, journal entry. We add a simple hyperlink out to a task record in ServiceNow and make the work ...