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

Conditional Fields based on other Field Values?


I'm currently creating a prototype to evaluate JIRA and ScriptRunner, and have some issues I need to learn about.
1- How do I set a "User Picker" field to display values based on another field's value on the same screen when creating an issue.
i.e: I have multiple Centers in my organization. If user picks Center = HQ, I need the "Manager" field to display only HQ Managers.
2- Also , what is the best way to set a series of users in the background based on that same choice. The issues will get assigned to those users as the flow moves forward. Currently I set a post function with the attached script. I then copy those values into "User" fields during transitions.

Thank you,

4 answers

2 votes
adammarkham Community Leader May 05, 2016

We have been investigating this since you posted this question. The short answer is its just about possible with Behaviours but we don't really provide an easy way of doing this sort of thing unless you write your own REST endpoint.

I have raised a feature request and we will add this feature in a future sprint. You can track the progress of it here:

If your going to roll your own thing then I suggest you read up on the documentation I have linked you to here.

We do a similar thing for picking issues, you can see the examples here:

If your comfortable with the examples provided above then you could write your own.

Using behaviours and setting the following script on the field where the user selects "managers" would work if you have defined those endpoints yourself like in the examples:

if (getActionName() == "Create") {

    def selectListField = getFieldById(fieldChanged)
    def multiUserPicker = getFieldByName("TextFieldForUsers")

    if (selectListField.value == "Managers") {
        // set manager users here using multiUserPicker
                ajaxOptions: [
                        url : getBaseUrl() + "/rest/scriptrunner/latest/custom/myissuepicker/managers",
                        query: true,
                        formatResponse: "general"
    } else if (selectListField.value == "Other") {
        // set other users
                ajaxOptions: [
                        url : getBaseUrl() + "/rest/scriptrunner/latest/custom/myissuepicker/otherusers",
                        query: true,
                        formatResponse: "general"

For the second question, it sounds like if you want to select a series of users based on a transition change then post-function are the best way.


Hope this helps.


Are there any updates availables about this please ?
I am interested in this feature in Scriptrunner.



0 votes
adammarkham Community Leader May 05, 2016

For 1) is it a single user picker or a multi one you are using?

Also would you be able to add the following tag to your answer so other people can find it when they search: groovy-script-runner



I was planning on using it for single user picker, but would be helpful to know if it were also feasible for multi user picker

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Keep your team in the loop with Team @mentions in Jira Software!

Hi everyone! My name is Jenny, a Product Manager at Atlassian. After launching Team @mentions in Confluence, we heard a lot of positive feedback from customers that they love how easy it is to @men...

220 views 4 12
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