- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2022 08:35 PM
Hi All,
Actually For one knowledge base we have some categories, so for that every category , we have approver, So whenever we submit article for this KB, before publish we need approval based on the category?
Please help to complete this
Thanks
Deepika
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2022 09:46 PM
Hi you dont need to modify OOB Script include. You can handle this in workflow.
In knowledge approval workflow before Approval user Activity. You can add a IF condition to check your knowledge base sys id which needs to go for category approval . If yes in the next activity you can add a approval user activity to push the approvers based on categories. If knowedge base is not matched. you can use existing flow to connect.
Refer attached screenshot for sample
If activity script:
answer = ifScript();
function ifScript() {
var kBase = current.kb_knowledge_base;
gs.info("KBASE"+kBase);
if (kBase == 'a7e8a78bff0221009b20ffffffffff17') { //KnowledgeBAse sysid
return 'yes';
}
return 'no';
}
Approval User Script:
answer = [];
if(current.kb_category == 'ed1c2552ff0131009b20ffffffffff65') // category name
answer.push('1c8c17a307010110f1cbf48f7c1ed089'); // usersysid
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2022 08:55 PM
Hi in Knowledge base we have a field called publish workflow. This workflow publishes the article. Check which workflow is doing that. Once you find out the workflow you can add a activity before publish to check categories of knowledge base and push for the approval.
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2022 09:06 PM
Hi Harish,
Thanks for the response,
So basically we are using ootb publish workflow, in that activity , there script include involve, so i am not sure where i need to do changes
So can you please tell me the where i need to do neccessary changes?
Thanks
Deepika

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2022 09:46 PM
Hi you dont need to modify OOB Script include. You can handle this in workflow.
In knowledge approval workflow before Approval user Activity. You can add a IF condition to check your knowledge base sys id which needs to go for category approval . If yes in the next activity you can add a approval user activity to push the approvers based on categories. If knowedge base is not matched. you can use existing flow to connect.
Refer attached screenshot for sample
If activity script:
answer = ifScript();
function ifScript() {
var kBase = current.kb_knowledge_base;
gs.info("KBASE"+kBase);
if (kBase == 'a7e8a78bff0221009b20ffffffffff17') { //KnowledgeBAse sysid
return 'yes';
}
return 'no';
}
Approval User Script:
answer = [];
if(current.kb_category == 'ed1c2552ff0131009b20ffffffffff65') // category name
answer.push('1c8c17a307010110f1cbf48f7c1ed089'); // usersysid
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-13-2022 11:58 PM
Hi
Thanks for the code,
And basically we have custom field called 'manager " in category , So we need to push him as an approver
Thanks
Deepika