KB version not creating more than 2-3 if calling OOB script include "new KBVersioning().checkout()
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2023 11:06 PM
Hi all,
we have OOB script include which is used in UI action ->Checkout->script include[var newRecord = new KBVersioning().checkout(current);].
I am using this script include in Flow designer action to checkout and publish KB Article.
If I am manually testing action, it is working for single records, but if am using it in flow to checkout multiple KB article, it is not working, record not found error I am getting.
Action:
script-
function execute(inputs, outputs) {
var sysID = inputs.sysid;
var kbRecord = new GlideRecord('kb_knowledge');
kbRecord.addQuery("sys_id", sysID);
kbRecord.query();
if (kbRecord.next()) {
var newVersion = new KBVersioning().checkout(kbRecord);//OOB script include for create new version of KA
if (newVersion) {
// Capture the sys_id of the new version
var newVersionSysID = newVersion.sys_id.toString();
outputs.newver = newVersionSysID;
}
}
}
execute(inputs, outputs);
Flow:
Thanks,
Chandan
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2023 11:55 PM
Incase it's running, only one record is running.