Dynamic population of a custom field on selecting value from other custom field.

Ruchika T October 13, 2015

I have few custom fields of type drop-down in the Create Issue page.

On change of custom field 1, based on the value selected, I want to populate custom field 2 and so on.

Can anyone help me on how to achieve this.

Thanks in Advance for the help!!!

Ruchika

1 answer

0 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 13, 2015

Most simple option is to swap custom field 1 and 2 for a "cascading select".

The more complex options involve add-ons to enable this sort of behaviour.

Ruchika T October 14, 2015

Requirement is to populate these drop down dynamically. On selection of a value from dropdown1 i'll fire a query to get corresponding values for dropdown2 and dynamically populate it with these values.Can I still use cascading select for dynamic values. If yes, can u please provide some sample code on how to do it. I am using Jira version 7.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 14, 2015

Yes, that's exactly what a cascading select does. You select an item from the left hand drop-down and that determines the options listed in the second drop-down. You don't need any code at all.

Ruchika T October 20, 2015

Thanks Nic. But in cascading select what I could see, we beforehand configure static data in the list.Say, for value "A" in dropdown1, I configured values "A1","A2","A3" etc in the drop down2. In my case, I don't have data for dropdown2 beforehand to configure. I'll only get this data from some code which will fire some query in the database and based upon these values which I get will populate the dropdown2. How can this be achieved in Jira.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 20, 2015

Oh, hang on, you're saying you don't have the values for the options yet? I think I've misunderstood part of the question. The answer about add-ons definitely applies then. JIRA's options are dynamic (selected by current data for some fields), but you do have to pre-define them before they can be used. >some code which will fire some query in the database and based upon these values which I get will populate the dropdown2 That's where add-ons apply - you will need to find or write an add-on to do that. You're asking JIRA to retrieve a set of values and then store what the user selects, with no previous knowledge of that data. I'd take a look at the database fields available in the marketplace first, but I'm pretty sure you're going to have to write something.

Suggest an answer

Log in or Sign up to answer