Can Scriptrunner limit the Assignee list based on another field when creating an issue?

When creating an issue, our users has to select what team should be assigned the issue. (The teams field will either be a listing of jira groups or an Insight custom field refeering to a list of teams in the Insight plugin. We have not decided yet on this).

Based on what team is selected, we would like the choises of users in the default Assignee field to be narrowed down to only those poeple belonging to that team.

(I know we can do something similar by duplicating all users into Insight, linking those to the teams, and then use an Insight custom field on the Create form to display the limited list of Insight users, but that is not a good solution for us.)

Is there a way to use Scriptrunner (or something else) to do this?

1 answer

Hi Johannes.

Yes, you can do this via custom validators.

You would use a custom validator onCreate transition to make sure that the assignees are in a group of names of your choosing.

Do you understand what I mean, or would you need help actually coding this?

However, mind you, we at Scriptrunner do not officially support interaction with Insight, and I couldn't help you code that part. 

Thanks for your answer, Daniel,

What we need is to present the limited list of possible assignees to the user, based on the prevoius choise.

Would this validator do this, or would it merely give an error if one selects an assignee which is not "accepted"?

Ah. This is a bit more complicated then. No, validators would not work. 

You would need to use behaviours. There are a few guides in our documentation regarding limiting and restricting options from multi-selects and single selects.

You can check out these guides here

I would use one of them to base myself upon and build the script that you require.

May I help you further?

Cheers!

Dyelamos

Thanks again,

When I look at how behaviours work, it looks like the options presented to the user is picked from a list allready loaded into the browser on the client side. We have about 1000 assignees to pick from, so if my understanding is correct this would probably present a perfromance issue.

Am I maybe misunderstanding? Could you maybe provide me with an example on how this would be implemented?

Yes, that could be a performance issue. 

I'm actually not very sure how to do this for very big instances.. I've only been working on the development team for SR for a year, so I'm not a master yet. 

In that case, I would really just use validators. It will prove a pain for some users, specially if you don't have a way to easily identify the users...

I'll ask around my team to see if someone has a better approach to this. Let me get back to you tomorrow. 

Cheers!

Dyelamos

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

412 views 0 3
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you