- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2024 03:05 PM
Hi,
Has anyone been able to change the link that gets populated in the comments after clicking the 'Attach to Case' button on the KB pop-up?
1. Open the 'related search'
2. find a KB and press either on 'Attach' button OR if you click into the KBA, you should see 'Attach to Case'
3. After clicking, this gets populated automatically in the comments, we want to change the link to something else but aren't sure where to change it
Thanks in advance for the help.
Best,
Saul
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 12:03 PM
Solution was to create a client script:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0717995
1. The Knowledge Article Link is populated from the Script include cxs_knowledge which is read-only and cannot be edited.
2. However, we can still modify the link by creating an onChange Client Script on the comments field which is populated with the Knowledge Article link when we click the “Attach” button from the contextual search results.
3. Here is an Example client script on Comments fields for overriding the link to view in Portal:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if(newValue.includes('kb_view')){
g_form.setValue('comments', newValue.replace('kb_view.do?sys_kb_id', 'sp?id=kb_article&sys_id'));
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 12:03 PM
Solution was to create a client script:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0717995
1. The Knowledge Article Link is populated from the Script include cxs_knowledge which is read-only and cannot be edited.
2. However, we can still modify the link by creating an onChange Client Script on the comments field which is populated with the Knowledge Article link when we click the “Attach” button from the contextual search results.
3. Here is an Example client script on Comments fields for overriding the link to view in Portal:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
if(newValue.includes('kb_view')){
g_form.setValue('comments', newValue.replace('kb_view.do?sys_kb_id', 'sp?id=kb_article&sys_id'));
}
}