Hi,
I try to add a simple script to a workflow transition.
I want only let the current user transition the issue if he is in a specific role and at the same time the value of a multi select field has the value "y".
Is this possible?
Hi there,
So the condition for the specific role (and assume you mean a project role)
Issue issue = issue def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser() def roleManager = ComponentAccessor.getComponent(ProjectRoleManager) def projectRole = roleManager.getProjectRole("Administrators") //if project role Administrators does not exist return false if (!projectRole) return false //will return true or false if the user is in Administrators role def isInRole = roleManager.getProjectRoleActors(projectRole, issue.getProjectObject())?.getApplicationUsers()?.contains(user) //the value of a multi select field has the value 'My value' def hasValue = 'My value' in cfValues['My Multi List']*.value //or any other combination return isInRole && hasValue
regards, Thanos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.