JIRA Behaviour change one field based on change to another

I have worked through how to use Behaviours to update a select list options at form initialization. I think that there should be a way to update the select list options based on a change to another field on the screen. I think that this should be part of a condition, but I can't figure out how this gets configured in the Behaviour module.

 

1 answer

1 accepted

0 votes

Hello,

Let s say you have two fields: "Parent field", "Child field". You have to create a behaviour and add "Parent Field" to the behaviour. Then you should add a script to the "Parent Field" (it is important to add the script to the Parent Field not to the behaviour as you did before).

You script would look like this

def parentField = getFieldByName("Parent Field")
def childField = getFieldByName("Child Field")
if (parentField.getValue().equals("1"))
{ chilField.setFormValue("my value")}

I did not check the script but that is the idea how it should work.  If you have any further questions, do not hesitate to ask.

Great - you answered my question. It is not clear from the documentation (or I just did read it closely enough) that the behaviour of the field is triggered on the change to the field. Now that I see it, it becomes pretty obvious.

Suggest an answer

Log in or Join to answer
Community showcase
Teodora [Botron]
Published Feb 15, 2018 in Marketplace Apps

Jira Inferno: The Nine Circles of Jira Administration Hell

If you spend enough time as a Jira admin - whether you are managing a single, mid-sized instance, a large enterprise one or juggling multiple instances at once - you will eventually find yourself in ...

1,007 views 5 18
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot