Ui action visibility based on Assignment Group

abirakundu23
Mega Sage

Hi All,

 

There is one requirement "Action" button will be visible for 15 assignment groups. we can add condition in condition field of Ui action, but there is string length limitation. is there any other approach to achieve this requirement?

Condition: gs.getUser().isMemberof('xyz') || gs.getUser().isMemberof('abc') || gs.getUser().isMemberof('pqr') || gs.getUser().isMemberof('srp') || gs.getUser().isMemberof('wer') || gs.getUser().isMemberof('uio') ||gs.getUser().isMemberof('xyz1') 
Please assist here.

2 REPLIES 2

Moin Kazi
Kilo Sage
Kilo Sage

You can write script include and call your script include in UI action condition. That way you can achieve this scenario.

Sainath N
Mega Sage
Mega Sage

@abirakundu23 : In this case, you can convert your condition check to script include and call script include from the UI Action Condition field. Please refer the below articles which might help you with the structure.

https://www.servicenow.com/community/itsm-forum/how-to-call-script-include-in-ui-action/m-p/478829

https://www.servicenow.com/community/developer-forum/how-to-call-script-include-in-ui-action-conditi...

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.