Which one should I use task_rel_kb table or m2m_kb_task table?

Masa4
Giga Contributor

I would like to allow to add relationship between incident_task and kb_knowledge to the user who has role "snc_internal" in the "Incident Task" record form.

And I assume that this user has not role "admin".

Which one should I use task_rel_kb table or m2m_kb_task table in this case?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

You can create relationship between incident and kb_knowledge using 2 ways

1) kb_knowledge table has Source Task field which gets populated with INC

-> this happens when incident is closed with the Knowledge checkbox as true

OR

2) use the table m2m_kb_task which stores the mapping of INC and KB

-> this happens when you attach knowledge using the Related Search result

Regards
Ankur

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

View solution in original post

8 REPLIES 8

Hi,

no

the relation is between INC and KB and not INC Task and KB

you will have to create defined relationship and give this query

(function refineQuery(current, parent) {

	// Add your code here, such as current.addQuery(field, value);

	current.addQuery('source', parent.parent);

})(current, parent);

find_real_file.png

Regards
Ankur

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

Hi

I found the related list of "Attached knowledge" for m2m_kb_task table in the "Incident Task" form.

Can I use this to store relationship between knowledge and Incident Task?

 

BR,

Hi,

yes that should be fine since incident_task table also extends task table

Regards
Ankur

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

Hi,

OK. I will try to use m2m_kb_task table.

BR,