Knowledge Article Approval Script

gsuprumanian
Tera Contributor

I am looking to modify KB approval workflow (ootb), where the scenario here is for a KB article with Category =Value , the approval need to be routed to owned_by of the CI.

gsuprumanian_2-1737955622398.png
This is my redesign of OOTB KB -Approval by adding the Block (2) and (3)

gsuprumanian_0-1737958242499.png

 


Block (2) - Added if, check the condition where kb_categories = "value", 

 

gsuprumanian_3-1737956359042.png

 

if Block (1) return

Yes, it will go to Block (3) where it need to be scripted where the approval will CI > Owned By.

No, it will go to normal Out-of-the-box route, where approval will be from KB Managers

I have challenge since not used to scripting, base on the Block (3), I need to use the advance option to add the script to get the approval name from CI, any suggestion how to simplify this? 

 

 

1 ACCEPTED SOLUTION

Viraj Hudlikar
Tera Sage

Hello @gsuprumanian 

 

In your approval activity under script field, you can put below code

answer = [];

answer.push(current.cmdb_ci.owned_by); // dot walk is done from ci field to owned by field.

 

If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

View solution in original post

2 REPLIES 2

Viraj Hudlikar
Tera Sage

Hello @gsuprumanian 

 

In your approval activity under script field, you can put below code

answer = [];

answer.push(current.cmdb_ci.owned_by); // dot walk is done from ci field to owned by field.

 

If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

Looks like this will work, let me give it a try.