Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,363,077
Community Members
 
Community Events
168
Community Groups

jira scriptrunner user belongs to group

I have a user A, I need to figure out whether A belongs to GroupA or not.

1 answer

1 accepted

4 votes
Answer accepted

If you use scriptrunner then in the script console you can execute something like 

import com.atlassian.jira.component.ComponentAccessor

def groupA = ComponentAccessor.groupManager.getGroup("GroupA")
ComponentAccessor.groupManager.getUserNamesInGroup(groupA).contains("usernameA")

Hi @Thanos Batagiannis [Adaptavist] ...how would you do the same but in scriptrinner for cloud?

@Thanos Batagiannis [Adaptavist] , how can we do this for multiple users , I have to check 1000 users if they are part of any group which starts with "abc" 

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events