data policy on knowledge base

anasuyaray
Kilo Expert

HI,

There is a data policy on knowledge called Enforce Knowledge Base Field. It is setting knowledge base mandatory while inserting the record.

Problem Create Knowledge business rule is inserting the knowledge from a closed problem and it is setting the value of knowledge base:

kb.kb_knowledge_base = gs.getProperty("glide.knowman.task_kb", "dfc19531bf2021003f07e2c1ac0739ab");

I want knowledge base field to be empty and mandatory while creating the knowledge article from problem. Otherwise it should be working as it is.

How to give this condition ? I have tried to write an insert business rule, But it is throwing data policy exception from Enforce Knowledge Base Field

(function executeRule(current, previous /*null when async*/) {

var ob = new GlideRecord('problem');

  ob.addQuery('sys_id',current.source);

  ob.query();

  if(ob.next()){

  current.kb_knowledge_base ='';

  }

})(current, previous);

Please help me out in this.

Regards,
Anasuya

6 REPLIES 6

The moment i posted, I realised i misunderstood your question.


Answer has been already provided by Abhinandan and Deepa


Hi Anasuya,



Did the proposed solution work out? If yes ,please mark Correct to close this thread...



Thanks,
Deepa