Hidding the transition for everyone except for 2 groups

Hello,

I would like to hide transition for everyone except for the groups "Change Managers" and "Process Supervisors". I guess via script and conditions it should be possible somehow. Any ideas about the code and how to get it done?

Thanx!

Rok

2 answers

4 votes

You don't even need script-runner for this - the condition "user is in group" is present in off-the-shelf JIRA.

I know about that and I use it often, maybe I should have given the more detailed explanation. In this particular case all the users are able to do transitions, because I have automatic Sub-Task blocking conditions system up, and in most cases transitions are automatic, etc. But when the ticket doesn't get automatically transitioned, I have this hole in my system that transition becomes visible to everyone which is not good. When I place "User is in group" condition, automatic system stops working sadly, that's why I wanted to simply hide the transition from everyone who isn't supposed to do it when it comes to "manual situation" Cheers, Rok

Steven Behnke Community Champion Nov 25, 2015

Would it be possible to see this via a screenshot? I think I have an understanding of what your issue is but I'm not sure where the "hole" comes from.

Yes, it would have been useful to tell us the full situation. I think this is a complex setup and you need to show us the conditions on this transition in full.

Hi Rock, 

maybe this is what you need: 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.util.UserUtil
 
// get users groups
def curUserGroups = ComponentAccessor.getUserUtil().getGroupNamesForUser(curUser.getName())
 
if (curUserGroups.contains("group1") || curUserGroups.contains("group2")) {
	// do something (return true) 
} else {
	// do something different (return false)
}

Hope this helps.

Cheers, Mario 

Thanx man :), I'll check into it!

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Thursday in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

303 views 0 12
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot