we need to give the approvals for Knowledge article before publish based on the category?

Deepika61
Tera Contributor

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

1 ACCEPTED SOLUTION

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

Regards
Harish

View solution in original post

5 REPLIES 5

Harish KM
Kilo Patron
Kilo Patron

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. 

Regards
Harish

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

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

Regards
Harish

Hi @Harish KM 

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