Hidding the transition for everyone except for 2 groups


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?



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 Sign up to answer
Community showcase
Posted Oct 09, 2018 in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

386 views 6 0
Join discussion

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