In follow-up to my previous question (https://community.atlassian.com/t5/Adaptavist-questions/Hide-UI-elements/qaq-p/1481462):
How do I create a condition where the hiding of UI elements ONLY applies to: anonymous users OR logged in users that are member of group XX
Found it myself..
import com.atlassian.jira.component.ComponentAccessordef groupManager = ComponentAccessor.groupManagerdef loggedInUser = ComponentAccessor.jiraAuthenticationContext.loggedInUserfinal username = loggedInUser.usernamedef groupNames = groupManager.getGroupNamesForUser(username).contains("jira-administrators")groupNames == true
It looks like you're new here. Sign in or register to get started.