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 @Ankur Bawiskar  can you please help here.

Harish KM
Kilo Patron
Kilo Patron

Hi @Renu9 Could you please share screenshot where you want to attach KB?

Regards
Harish

Renu9
Tera Contributor

Hi @Harish KM  Pleases find the screenshot. In this related list, I want to attach KB articles once Incident record is created from Record producer.

Renu9_0-1698290262672.png

 

Hi @Renu9 you can have the below script in your record producer script:

var kb = new GlideRecord('m2m_kb_task');
kb.initialize();
kb.task = current.sys_id; // sysid of incident record
kb.kb_knowledge = '7c8f75b5474321009db4b5b08b9a71b5'; // sysID of KB Article to insert
kb.insert();
 
HarishKM_0-1698291075955.png

 

Regards
Harish