Allow Author of KB to checkout article

Dawid2
Giga Guru

We have OOB author field on the KB Article form.

If article is in published state, author should be able to checkout for a new version. I've added condition to the UI Action "Checkout" current.workflow_state == 'published' && current.author == gs.getUserID()

And while author can see the button, upon clicking it it says You cannot checkout this article as it is already checked out.

This author has itil role and does not have any knowledge related roles (that's the main idea here).

How can this be achieved?

1 ACCEPTED SOLUTION

Dawid2
Giga Guru
Okay, I figured it out.
 
There is script include called KBVersioningSNC that controls behavior of different functions like canContribute or canCheckout.
 
Since it's read only, I had to override it in KBVersioning script include by modifying canCheckout function with line:
if(current.author==gs.getUserID())
return true;
 
And it works.

View solution in original post

5 REPLIES 5

sachin_namjoshi
Kilo Patron
Kilo Patron

Hi, I saw that but it does not give me any idea. I think the best way would be to override base function in script include but I have no idea how to do it.

Dawid2
Giga Guru
Okay, I figured it out.
 
There is script include called KBVersioningSNC that controls behavior of different functions like canContribute or canCheckout.
 
Since it's read only, I had to override it in KBVersioning script include by modifying canCheckout function with line:
if(current.author==gs.getUserID())
return true;
 
And it works.

Yogita11_
Tera Contributor

Hello @Dawid2

Giga Guru

I'm revisiting the customization for enabling checkout functionality for custom group members. You mentioned adding code to the "KBVersioning" script include.

However, upon reviewing the "KBVersioning" script include, I couldn't locate a "canCheckout" function. My findings indicate that this functionality, and the associated code, appears to reside within the "KBVersioningSNC" script include.

Could you please elaborate on how you implemented this solution? Specifically, I'd appreciate a more detailed explanation of your approach given the discrepancy in the script include where the code was expected.

Yogita11__0-1749819586997.png