- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 07:58 AM - edited 01-25-2023 07:59 AM
Hi everybody! I've created a ui action button, but I want that button shows only for specific people, so maybe for groups. I've tried to use some script on the condition but nothing seems to work, here some of the script in the condition that I've used:
1) current.state == 1 && (gs.getUser().isMemberOf(current.assignment_group == '445334299780e1981fadb6e3f153aff2' )) || (gs.getUser().isMemberOf(current.assignment_group == 'bc2370e59780e1981fadb6e3f153afca'))
2) current.state == 1 && (gs.getUser().isMemberOf(assignment_group == 'Test1' )) || (gs.getUser().isMemberOf(assignment_group == 'Test2'))
3) current.state == 1 && (gs.getUser().isMemberOf('Test1' )) || (gs.getUser().isMemberOf('Test2'))
Somebody could tell me how to resolve it? When I try to impersonate people of other groups(so not people part of group test1 and not of group test2) I see the button anyway when I shouldn't. Any suggestion?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 08:12 AM
Hi @Alessia Russo ,
Almost whatever you are doing is correct, only braces caused problems i think.
try the below in condition.
current.state == 1 && (gs.getUser().isMemberOf('Test1' ) || gs.getUser().isMemberOf('Test2'))
Mark helpful if it helps in solving your query.
Regards,
Johns
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 08:12 AM
Hi @Alessia Russo ,
Almost whatever you are doing is correct, only braces caused problems i think.
try the below in condition.
current.state == 1 && (gs.getUser().isMemberOf('Test1' ) || gs.getUser().isMemberOf('Test2'))
Mark helpful if it helps in solving your query.
Regards,
Johns
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 08:17 AM
thank you! now it works!