Knowledge Article to Publish Article via Transform Script

Saib1
Tera Guru

Hi,

I am trying to update the Knowledge Article which is Published . 

Without Affecting the Workflow how to update it via Transform Map .

 some thing like setWorkflow =false

Is there any Transform Script to do it?

 

 

1 ACCEPTED SOLUTION

shloke04
Kilo Patron

Also to add, when you un check the "Run Business Rule" field as false it will not trigger any script when you transform your data which is same as setWorkflow(false)".

Please let me know if you have a follow up query on this.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

View solution in original post

7 REPLIES 7

shloke04
Kilo Patron

Also to add, when you un check the "Run Business Rule" field as false it will not trigger any script when you transform your data which is same as setWorkflow(false)".

Please let me know if you have a follow up query on this.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Saurav11
Kilo Patron
Kilo Patron

hello,

Below is a sample script, now in the addEncodedQuery you will have to use the source field based on what you are keeping as primary key

var kb = new GlideRecord("kb_knowledge");
kb.addEncodedQuery("number=KB0010002");
kb.query();
if(kb.next()){
kb.category="sys_idofcategory";

kb.setWorkflow(false);
kb.update();

}

 The above is just an example for category you can use it for whichever field you want to.

Please mark answer correct/helpful based on Impact

shloke04
Kilo Patron

In case if you want to go with a Background Script below is an example on how to use a background script to update your knowledge articles:

var gr = new GlideRecord('kb_knowledge');
gr.addEncodedQuery('Query here');
gr.query();
while(gr.next()){
gr.FIeldName = 'Value to update';
gr.setWorkflow(false);
gr.update();
}

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke