Hello everyone
This has been asked quite a lot already but I was unable to find an appropriate solution for our use case.
I really only need a behaviour which will run on all projects on all issuetypes and on every screen.
This behaviour should remove some options from the assignee field.
We cannot do this with the assignable user permission as these users should be able to be assignees but just not at every point and we would like to prevent our users from manually selecting them.
I also found the option of using a workflow validator but then again, after creation of the issue, the user could just edit the issue and then re-assign it which is why a behaviour would work best.
Can anyone help us out here on where to begin with this?
Thanks!
I don't think scriptrunner behavior setFieldOptions() method can run on the assignee (or any user fields) to limit the available list.
At best, you can react to change in the assignee field and validate the value with the behavior and use the setError() method to stop users from saving while an invalid user is selected.
def okList = ['user1','user2']
def fld = getFieldById(getFieldChanged())
if(fld.value in okList){
fld.clearError()
} else {
fld.setError("Not a valid assignee. Pick from $okList")
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.