Add link in HR Response Template

Nicole Solarz1
Giga Contributor

Is there a way to link a specific knowledge article in an HR Response Template? It would save a step to just have the link in the response instead of also attaching the KB to the case. Thanks!

1 ACCEPTED SOLUTION

Hyperlink will not work since OOB attributes which makes show you tinyMCE editor are not configured for template body field on response template table.

 

Follow below steps to add tinyMCE editor for template body field

 

- Go to dictionary of template body column on response template table.

 

https://dev41006.service-now.com/nav_to.do?uri=%2Fsys_dictionary.do%3Fsysparm_query%3Dname%3Dsn_templated_snip_note_template%5Eelement%3Dhtml_script_body%26sysparm_query_encoded%3Dname%3Dsn_templated_snip_note_template%5Eelement%3Dhtml_script_body%26sysparm_referring_url%3Dsn_templated_snip_note_template.do%3Fsys_id%3D148950212f4ce8101d84d2172799b630@99@sysparm_record_rows%3D1@99@sysparm_record_target%3Dsn_templated_snip_note_template@99@sysparm_nostack%3Dtrue@99@sysparm_record_list%3Dtable%253Djavascript%253Anew%2Bsn_hr_core.hr_CaseAjax%2528%2529.getAllHRCaseTables%2528%2529%253B%255EORtable%253Dsn_hr_core_task%255EORDERBYname@99@sysparm_record_row%3D1%26sysparm_view%3Dadvanced%26sysparm_view_forced%3Dtrue

 

- Add below attributes to template body column and save changes.

 

convert_urls=false,serializer=com.glide.script.TranslatedTextXMLSerializer,tinymce_toolbar1=true,editor.height=300,editor.plugins=table colorpicker textcolor link image media codemirror lists advlist fullscreen charmap directionality emoticons hr insertdatetime nonbreaking pagebreak print searchreplace wordcount anchor toc codesample visualblocks visualchars compat3x autolink align_listitems,editor.toolbar= fontselect fontsizeselect | bold italic underline strikethrough forecolor backcolor pastetext removeformat |  formatselect  searchreplace undo redo |  bullist numlist outdent indent alignleft aligncenter alignright | toc table  link unlink  image media codesample | code fullscreen,encode_utf8=false,serializer=com.glide.script.TranslatedTextXMLSerializer

 

 

find_real_file.png

 

- After doing this, the template body column will start showing TinyMCE editor which you can use add hyperlink just like the way you do in knowledge articles.

 

Regards,

Sachin

View solution in original post

8 REPLIES 8

Hi Nicole,

 

Did you find any solution for this?

 

Thanks

I'm looking for the same thing, apparently this was functional in our instance and broke yesterday.

 

I also looked at the Link added in response templates is not carrying over to the clipboard

Hey @Nik27, I just came accross this problem, and the workaround for us was the usage of code blocks in journal fields.

 

Prerequisite: you need to have the `glide.ui.security.allow_codetag` system property set to true.

 

Once you have that, you can wrap HTML elements inside [code][/code] tags, in this particular case, an anchor element, e.g.:

[code]<a href="https://www.yourlink.com" target="_blank">Your URL Text</a>[/code]
 

Note: this will only work for journal fields, so it only makes sense to use it for the Form channel, when it's pasted into comments/work notes. For other channels, you should be able to use the response templates without any such hacks.

 

but still no luck

The "Link added in response (...)" actually does work just make sure that the HTML is in front and visible, so when you look at the template you should see the actual HTML code that is wrapped with [code][/code]

[code]<a href="http://www.service-now.com">ServiceNow</a>[/code]

 

I tested this in our instance and my PDI, it does work

 

See Render journal field entries as HTML

Results of entering HTML code
Code entered	Result
[code]<a href="http://www.service-now.com">ServiceNow</a>[/code]	The system renders a hyperlink to the ServiceNow web site.
[code]<b>This text will be bold. </b>[/code]	The system renders the sentence in bold.
<b>This text will not be bold.</b>	The system escapes the bold tags and renders them as text.
[code]<script> gs.info(gs.getUserDisplayName());</script>[/code]	The system escapes the content of the script tag.
Note: By default, the HTML Sanitizer prevents the entry of <script> elements.

Kalyani35
Tera Guru

HI Nicole,

Did you find any solution for this? I have similar requirement.

Thanks!