Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

I want to create latest version of article only if I am the author of the article??

utsavjaiswa
Tera Contributor

Hello @Everyone

Is it possible that I can create a latest version of an published article only if I am the author of the article??

Please let me know your views
Thanks in Advance

Warm Regards

Utsav

4 REPLIES 4

M Iftikhar
Tera Sage

@utsavjaiswa , You can modify UI action which runs for creating version by setting condition field to 

current.author == gs.getUserID()

OR run a Business rule to check if author is current logged in user then proceed with version creation else abort the action.

var original = new GlideRecord('kb_knowledge');
if (original.get(current.source_id)) {
if (original.author != gs.getUserID()) {
gs.addErrorMessage('Only the author of the article can create a new version.');
current.setAbortAction(true);
}

 

 

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

@utsavjaiswa, If my solution helped, mark it as the accepted solution and close the thread so that future learners can get the solution more easily.

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

Ankur Bawiskar
Tera Patron
Tera Patron

@utsavjaiswa 

this happens OOTB and you need not customize anything.

The OOTB UI action already checks this.

If that's not happening in your instance then see who updated the OOTB UI action condition

💡 If my response helped, please mark it as correct ✔️ and close the thread 🔒 — this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

MIftikhar_0-1760358096580.png

Hi @Ankur Bawiskar, are you sure? Beth and the system admin can create versions of articles whose author is John Janson. So in my opinion an explicit script is needed to prevent version creation.

 

 

 

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.