Autopopulate Kb article in incident related list

Renu9
Tera Contributor
  • Hi All,

I am creating an incident record using record producer. I am having KB article to be attached to the  'Attach KB' related list in incident form. So , on the incident that is created via record producer, the KB has to be attached automatically 

Please help me in achieving this.

 

1 ACCEPTED SOLUTION

Hi @Renu9 below script will insert 2 articles

var kbSysID = ['7c8f75b5474321009db4b5b08b9a71b5','e45579bb04241300964fabaf188a645d']; // sysidd of 2 KB articles
// need to insert 2 records
for (var i = 0 ; i < kbSysID.length ; i++){
var kb = new GlideRecord('m2m_kb_task');
kb.initialize();
kb.task = current.sys_id;
kb.kb_knowledge = kbSysID[i]; // sysID of KB Article to insert
kb.insert();
}
Regards
Harish

View solution in original post

6 REPLIES 6

Renu9
Tera Contributor

Hi @Harish KM  I will try it.i want to add 2 kb articles in the same incident.

Please help me with that as well 

Hi @Renu9 below script will insert 2 articles

var kbSysID = ['7c8f75b5474321009db4b5b08b9a71b5','e45579bb04241300964fabaf188a645d']; // sysidd of 2 KB articles
// need to insert 2 records
for (var i = 0 ; i < kbSysID.length ; i++){
var kb = new GlideRecord('m2m_kb_task');
kb.initialize();
kb.task = current.sys_id;
kb.kb_knowledge = kbSysID[i]; // sysID of KB Article to insert
kb.insert();
}
Regards
Harish