The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

evaluate a dropdown did user make a selection

Nat Luw
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!
September 12, 2019

can someone please give me a hand here (this is the first time i've ever posted a question)

i have a dropdown list being set to a default value in a behavior as follows

 

FormField issuelinks = getFieldById("issuelinks-linktype")

def issuelinksValue = issuelinks.getValue()

{issuelinks.setFormValue("dependent (relies) on")}

 

and now i want to evaluate whether the user has already made a selection to override the default value 

otherwise the behavior which sets the default keeps overwriting the user's selection

 

 

thanks

 

 

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Rakesh Kumar
Contributor
September 13, 2019

Hello Nathaniel,

You can set to initialise the value of required field to "dependent (relies) on". Then in the server side script just get the issuelinks field using below line of code

FormField issuelinks = getFieldById(getFieldChanged())

and add your validation codes subsequently.

Whenever, user will change the value of this fields, your script will validate the value dynamically and users don't even need to submit the form to get the value validated.

 

Regards,

Rakesh

Nat Luw
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!
September 18, 2019

thank you Rakesh for your response

i discovered that my initialising script was set on the field instead of the initialize - thus every time the user was making a selection - my script was re-setting the default ---- thank you

TAGS
AUG Leaders

Atlassian Community Events