You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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.