Hi Community,
The idea is, have on Jira only one field "Approver" created, and this field by default allows you to select one of the all users that you have in Jira.
Until here all is fine but now I want depends of the request type that the user select in the customer portal, show only the users of the one group.
I am traying doing something like this:
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.user.ApplicationUser
import groovy.transform.BaseScript
@BaseScript FieldBehaviours fieldBehaviours
FormField segAprueba = getFieldByName("Approver")
segAprueba.setLabel("Why do you need this?")
segAprueba.setDescription("Tell us why you want this.")
def users = ComponentAccessor.groupManager.getUsersInGroup("AAutomatizaciones JIRA")
ArrayList finalUsers = new ArrayList()
for (user in users){
finalUsers.add(user.key)
}
segAprueba.setFieldOptions(finalUsers)
But this doesn't work, have any ideas?
Adrián.