Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Scriptrunner behaviour for limiting assignee list

Deleted user June 6, 2019

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!

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Peter-Dave Sheehan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 19, 2019

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")
}
TAGS
AUG Leaders

Atlassian Community Events