Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Scriptrunner behaviour for limiting assignee list

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?


1 answer

0 votes

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){
} else {
fld.setError("Not a valid assignee. Pick from $okList")

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Apps & Integrations

Send an Email or Publish to Confluence - What should you do with your release notes?

Background When you hear the words ‘Release notes’, almost always you think of an unsolicited email from a software vendor. But I am here to tell you that from our data, sending release notes via E...

135 views 1 2
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you