Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

Hyperlink of KB article on kb_feedback_task table

Admin7267
Kilo Sage

I need the hyperlink of KB article to be added in the notification that triggers from 'kb_feedback_task' table.

2 ACCEPTED SOLUTIONS

Maik Skoddow
Tera Patron
Tera Patron

Hi @Admin7267 

according to the page https://docs.servicenow.com/bundle/tokyo-servicenow-platform/page/administer/notification/concept/c_... you should be able to get the link when using

${feedback.article.URI_REF}

 Maik

View solution in original post

Are you using it in the kb_feedback_task notification?

You have to create an email script by System Notification > Email > Notification Email Scripts.

Email Script:

MuhammadHamza_0-1702396175872.png

Then use this email script in the notification Message HTML field of kb_feedback_task table.

 

${mail_script:kb_article_link_from_kb_feedback_task}

 

KB Feedback Task Notification

 

MuhammadHamza_2-1702396681787.png

 

MuhammadHamza_4-1702396726140.png

 

After previewing the notification, we get,

MuhammadHamza_5-1702396782406.png

In this way, it's working for me. Hope it helps and solves your problem. If it does solve your problem, kindly mark this as a solution so it may help others in the future.

Regards,

Hamza

 

View solution in original post

7 REPLIES 7

Maik Skoddow
Tera Patron
Tera Patron

Hi @Admin7267 

according to the page https://docs.servicenow.com/bundle/tokyo-servicenow-platform/page/administer/notification/concept/c_... you should be able to get the link when using

${feedback.article.URI_REF}

 Maik

Thanks for the help, but it's not working @Maik Skoddow 
Not sure why

Thank you so much @Maik Skoddow, It was working as expected.

I see when I preview the notification Feedback task is selected that don't have article number for reference

Muhammad Hamza
Kilo Sage

Hey @Admin7267,

You can copy the link by going to that article in the portal

MuhammadHamza_0-1702383605560.png

You can paste the link in your mail script as this:

 

template.print('<a href="<INSTANCE_BASE_URL>/sp/en/what-are-phishing-scams-and-how-can-i-avoid-them?id=kb_article&sysparm_article=KB0000028">Article</a>');

 

If you want the link to the KB article on the platform:

 

template.print("<a href='"+gs.getProperty('glide.servlet.uri')+ "kb_knowledge.do?sys_id="+current.feedback.article + "'>"+current.feedback.article.getDisplayValue()+"</a><br/>");

 

If you want the link to the Article on the portal then:

 

var shrt_desc = current.feedback.article.short_description;
	var url_desc = shrt_desc.replaceAll(" ","-");
	// removing special character from the end
	url_desc = url_desc.replace("?","");
	url_desc = url_desc.replace("!","");
	url_desc = url_desc.replace(".","");
	template.print("<a href='"+gs.getProperty('glide.servlet.uri')+ "sp/en/"+url_desc+"?id=kb_article&sysparm_article="+current.feedback.article.number + "'>"+current.feedback.article.getDisplayValue()+"</a><br/>");

 

Then, you can use a mail script in your notification,

 

${mail_script:<EMAIL_SCRIPT_NAME>}

 

Kindly appreciate the efforts of community contributors by marking appropriate response as the correct solution and helpful, this may help other community users to follow the right solution in the future.

Thanks,

Hamza