Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


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
Community Members
Community Events
Community Groups

Disable Tab based on security group script disabling for everyone

Hi all


I would like to disable a tab for everyone but a specific security group but for some reason it's not seeing my condition and just disabling it for everyone


import com.atlassian.jira.component.ComponentAccessor

// Get the current user
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def groupManager = ComponentAccessor.getGroupManager()

if (ComponentAccessor.getGroupManager().getGroupsForUser(currentUser)?.find { != "Jira Service Desk Time Log" })


1 comment

Andrew Rising Star Jul 12, 2019

Hi @Steve Letch ,

I not sure that condition is well. != "Jira Service Desk Time Log"

If user have a lots group it return true for all groups!="Jira.."

Try some like next:

if (!ComponentAccessor.getGroupManager().getGroupsForUser(currentUser)?.find { == "Jira Service Desk Time Log" })


See I want to hide it from all users except that group so I need it to be a != unless you can think of a better way

Andrew Rising Star Jul 14, 2019

May I clarify?

someA = [a,b,c,d,f]

someB = [a,b,c,f]

someC = [a,b]

I suppose we want exclude 'd'. We should return 'true' for someB and someC.

1. return true only for someA:

if ( some.find{ it == 'd'} )
someA - true (can find 'd')

someB - false (cannot find 'd')

someC - false(cannot find 'd')

2. Inverse result:

if ( ! some.find{ it == 'd'} )
someA - false (can find 'd')

someB - true (cannot find 'd')

someC - true (cannot find 'd')



Log in or Sign up to comment