How to display "When an incident has a knowledge article attached the Knowledge articles "Incident" tab should reflect/populate the incident # that was attached to said article.

Ram141
Tera Expert

When an incident has a knowledge article attached the Knowledge articles "Incident" tab should reflect/populate the incident # that was attached to said article. 

22 REPLIES 22

Hi,

okay any field on incident you could find which stores knowledge; please check xml of the knowledge record

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I have searched both Incident and Knowledge Article record xml 's  and i don't see incident xml is storing knowledge related sys_id and Knowledge Article is storing incident related sys id.

i could see on incident record worknotes only updating as article attached.  

And they are using the below related list to attach Knowledge Article on Incident Form,

Hi,

in that case you can use this table to query in the relationship script section

please try this and check once

(function refineQuery(current, parent) {

	// Add your code here, such as current.addQuery(field, value);
        var incArray = [];
	var gr = new GlideRecord('m2m_kb_task');
        gr.addQuery('kb_knowledge', parent.sys_id);
        gr.query();
        while(gr.next()){
         incArray.push(gr.task.toString());
        }
	
    current.addQuery('sys_id', 'IN', incArray.toString());

})(current, parent);

Regards
Ankur

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I have added the highlighted "Attached To Task" Related list to the  below selected section and it solved the purpose,

Unfortunately i couldn't find "Attached To Task" Related list in the "sys_ui_related_list table and now not sure from where this related list came up.  find_real_file.png