ui action visibility

Snow-Man
Tera Contributor

Hello everyone, 

 

I have created a  UI Action on knowledge article form. 

This UI action should only be visible when logged in user is (member of ownership group or manager/S) of that PARTICULAR KNOWLEDGE BASE and also when workflow state is draft and version > 1.....

 

SnowMan_0-1726833370349.pngSnowMan_1-1726833378637.png

 

Thanks everyone,

Ak**bleep**

4 REPLIES 4

Sid_Takali
Kilo Patron
Kilo Patron

Hi @Snow-Man on your UI Action condition field add below code. Modify accordingly

 

current.state=='1' && gs.getUser().isMemberOf('your group sys_id') 

 

 

Voona Rohila
Kilo Patron
Kilo Patron

Hi @Snow-Man 

You can add condition in your UI Action.

1. To check if user is part of group or not then use : 

 

gs.getUser().isMemberOf('your group sys_id') 

 

 To check in Managers field, You can add below check

current.managers.indexOf(gs.getUserID()) > -1

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

sysid should be dynamic, as it will be different for different knowledge articles as their knowledge bases are different

You can use current.kb_knowledge_base.filedname to get dynamic sys_id.

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP