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 vote

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 Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published yesterday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

39 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