Hi,
I want to restrict my transition (Approve / Deny) based on which group the current user is a member of.
In order to achieve this I am using the script below
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
def groupManager = ComponentAccessor.getGroupManager()
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
groupManager.isUserInGroup(currentUser, "Murex Task Team")
The script returns true/ false when I change the group and when I run this in script console, as expected.
But when I add it to the Workflow Transition condition it always evaluates to true allowing me to complete the transition irrespective of the group specified , please can you suggest what's wrong with the script?
I know I can use the build in "User Is In Group "condition to do this, but I want to extend this to pickup the group name from a Custom field on the issue therefore I am trying this method.
Thanks
Sar