KB attach to Incident by URL broke record to M2M_KB_Task table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2022 04:50 PM
We implemented the functionality to allow a user to either add a KB URL or the actual KB article content to an incident however it seems that it broke the ability to accurately report from M2M_KB_Task table because it broke the business rule on the cxs_rel_doc_detail table which adds records to the M2M_KB_Task table. The cxs_rel_doc_detail table shows when a person previews a knowledge article, and/or attaches that knowledge article to an incident. Now records are only added to cxs_rel_doc_detail table when a user clicks on Preview and then “Attach to Incident” from that Preview window. However, if a person clicks on “Attach link” or “Attach article”, these actions are not recorded in cxs_rel_doc_detail. We are not able to find the functionality for where clicking the Attach button creates a record in the cxs_rel_doc_detail table. Does anyone know how to resolve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2022 07:13 PM
Hi
according to page https://docs.servicenow.com/bundle/sandiego-platform-administration/page/administer/contextual-searc... the intention of the table "cxs_rel_doc_detail" is a different one.
And there is a simple trick for checking where something is used/implemented in ServiceNow:
Just go to table 'sys_metadat' and search in the search box on the upper border for "cxs_rel_doc_detail" ´. Then group the results by "class".
In the below screenshot you can see that with the help of the Business rule "Create m2m_kb_task record on attach" also a record in table "m2m_kb_task" should be created. If not this could be a bug.
Kind regards
Maik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2022 11:00 AM
I do see this business rule and the advanced script contains url but it still isn't showing up if a user attaches the KB using the Attach Link or Attach Article. It only shows up if they go into Preview and attach the KB link from there.
(function executeRule(current, previous /*null when async*/) {
if (current.cxs_relevant_doc.source_doc) { // for existing records
var kbScript = new KnowledgeAjax();
kbScript.kbAttachArticle(current.relevant_doc + "," + current.cxs_relevant_doc.source_doc,current.relevant_doc_url);
}
})(current, previous);