Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

How to populate a hyperlink in comments using business rule.

Shri8
Tera Contributor

How to populate a hyperlink in comments using business rule.

https://dev12345.service-now.com/sp?id=kb_article_view&sys_kb_id=12345.

1 ACCEPTED SOLUTION

Saurav11
Kilo Patron

Hello,

Please use the below code in after business rule:-

var url = '';
url = "[code]<a href='";
url += 'https://dev12345.service-now.com/sp?id=kb_article_view&sys_kb_id=12345';
url += "' target='_blank'>" + current.number + "</a>[/code]";

current.comments = url;

current.update();

Please mark answer correct/helpful based on Impact

 

View solution in original post

7 REPLIES 7

Saurav11
Kilo Patron

Hello,

Please use the below code in after business rule:-

var url = '';
url = "[code]<a href='";
url += 'https://dev12345.service-now.com/sp?id=kb_article_view&sys_kb_id=12345';
url += "' target='_blank'>" + current.number + "</a>[/code]";

current.comments = url;

current.update();

Please mark answer correct/helpful based on Impact

 

Shri8
Tera Contributor

Hi Saurav,

 

Thank you. It worked.

Shri8
Tera Contributor

Could you please suggest if text can be added in place of current.number.

Yes you can add anything over there.