Publish UI Action is not working

Cupcake
Mega Guru

I have a script in the condition for the Publish UI Action for Knowledge but it doesn't appear to be working. My script is below.

role (kb_inc_mngt) has a Knowledge Base = Team A Knowledge Base

role (kb_cpt_mgmt) has a Knowledge Base = Team B Knowledge Base

What I am trying to solve for? 

     Only a member that has role kb_inc_mngt role should be able to publish articles that is in the Team A Knowledge Base

     Only a member that has a role kb_cpt_mgmt role should be able to publish articles that is in the Team B Knowledge Base.

I even tried updating the script in the condition to the following: !(new KBCommon().isStackNameDialog()) && (new KBKnowledge().canPublish(current) && gs.hasRole('admin') || (kb_knowledge_base== '614ee5296f68134019bf03d9ea3ee43f' && gs.hasRole('kb_inc_mngt')) ||
(kb_knowledge_base== '587e303edbeb9f40f5a3ab8b4b9619fc' && gs.hasRole('kb_cpt_mgmt')))

 

 

find_real_file.png

8 REPLIES 8

Good day to you Rogers. My customer has completely changed the requirement, but the solution you provided is a great idea. And I will most definitely keep this is my little secret handbook for the next go round.

You are much appreciated.

 

Karen

Allen Andreas
Administrator
Administrator

Hi there,

You could also try to see if you can tap in to the whole "can contribute" thing that we set up (in the other thread)...could try adding condition with something like this:

(new KBKnowledge().canContribute(current))

See if that works for you.

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Thank you for your response. I believe the customer is changing the requirement so this ask may no longer be needed.

Have a good rest of your week. Just waiting for the customer to get back to me.

Much appreciated.

Karen

Hi,

Sounds good. Let me know if you still need to work on this or not.

Please mark reply as Helpful though if it was.

Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!