It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to limit the script runner fragments to a particular user or a user group?


For the Script fragments there's an option to specify the condition. Is it possible to specify users/user groups in the conditions?


Thank you.

1 answer

1 accepted

2 votes
Answer accepted

You can write a condition like this

import com.atlassian.jira.component.ComponentAccessor
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
return ComponentAccessor.getGroupManager().isUserInGroup(currentUser,"jira-administrators")

It would check that the current user belongs to jira-administrators group.

Thanks Alexey, the script works.

Thanks Alexey..this works for me

Thnx, @Alexey Matveev -cPrime- this was very helpful!

Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you