- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2020 02:32 PM
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:
Would like to know if there is a way to display a hyperlink properly in both Service Portal and ServiceNow view of the RITM?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2020 07:03 PM
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]';
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2020 06:43 PM
Hello,
var req4 = new GlideRecord('sc_req_item');
req4.addQuery('sys_id',workflow.scratchpad.ritm_id);
req4.query(); // don't forget to query
while(req4.next()){
req4.work_notes = (msg);
req4.update();
}
Also refer this link to create hyperlink,
If answer is helpful please mark correct or helpful!
Thanks,
Pratiksha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2020 06:03 PM
Hello,
Previously you have marked an answer as correct. But due to multiple answer correct, Now mine answer is not showing mark as correct. It would appreciate if you mark answer as correct.
Thanks,
Pratiksha

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2020 07:03 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-26-2021 08:49 AM
where to write this code ? we have to write BR for this ?