- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 02:07 AM
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 02:36 AM
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
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 02:36 AM
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
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 02:37 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2022 02:37 AM
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
Regards,
Shloke