Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,560,125
Community Members
 
Community Events
185
Community Groups

JIRA Behaviour change one field based on change to another

Derek Fields
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jan 05, 2018

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
Answer accepted
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jan 05, 2018 • edited

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.

Derek Fields
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jan 05, 2018

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.

Hello, could you please clarify what it mean "add script to the field not to the behaviour"? You mean to field description? 

徐佐君
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Dec 16, 2022

Hi Alexey, your solution works on the editing page, the child field updated while changing the parent.

But I found it do not work on the creating dialog.  It is the popup window when creating. After the parent field was changed, the child field is expected to be updated.  The script seems do not work on this window. Do you have any idea? Thank you any way.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events