Hello there,
I have set a global transition in my workflow.
From anywhere to anywhere, in this way i can use the transition from everywhere in my workflow.
I would like to made this transition available only for specific usergroup and projet.
I have define a Script condition threw customscript, unfortunatly it's not working.
please, find below my scrip descritpion:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.security.groups.GroupManager
import org.apache.log4j.Category
log.debug("///////////////////////DEBUT CONDITION///////////////////")
ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
log.debug("user: " + user)
def componentManager = ComponentManager.getInstance()
GroupManager groupManager = ComponentManager.getComponentInstanceOfType(GroupManager.class)
String cee = "CEE"
String rso = "RSO"
log.debug("Cle projet: " + issue.getProjectObject().getKey().toString())
log.debug("user CEE? " + groupManager.isUserInGroup(user,cee))
log.debug("user rso? " + groupManager.isUserInGroup(user,rso))
log.debug("Gros test ok? " + ("CEE".equals(issue.getProjectObject().getKey().toString())) && (groupManager.isUserInGroup(user,cee) || groupManager.isUserInGroup(user,rso)))
("CEE".equals(issue.getProjectObject().getKey().toString())) && (groupManager.isUserInGroup(user,cee) || groupManager.isUserInGroup(user,rso))
I would like to be able to use this transition only if i am in CEE projet and a CEE user or RSO user.
the transition is available for all user ( not in CEE projet and not in CEE or RSO user group)
In my log file, i didin"'t reach the first log trace "///debut condition///" but the script run each time i use the transition.
Does anyone see what i am missing? i have not clue actually what i am doing wrong.