Dynamically change selections in custom field?

Bill Wonch August 6, 2013

Hi -

I'm interested in dynamically setting values in a dropdown list based on selection from another field. For instance:

Location: 1, 2, 3

Item: A, B, C

Location 2 may only have item A and C, so we would like to limit the options to that. Any suggestions?

Thanks!

Bill

3 answers

1 accepted

0 votes
Answer accepted
Christian Czaia _Decadis AG_
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.
August 6, 2013

You could also take a look at the behaviours plugin.

https://marketplace.atlassian.com/plugins/com.onresolve.jira.plugin.Behaviours

The second example Jamie is hiving might suit your needs:

https://jamieechlin.atlassian.net/wiki/display/JBHV/Miscellaneous+Behaviours+Examples#MiscellaneousBehavioursExamples-Addorremoveoptionstosingleormulti-selectfields

I've seen other plugins that do the same...

Cheers Christian

Bill Wonch August 6, 2013

Thanks for the link! I've been playing around with the Behaviours plugin a little. The fields aren't updating and I see the following error in my logs:

WARNING: A servlet POST request, to the URI http://dtc25003b1c80d7:8082/rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/runvalidator.json, contains form parameters in the request body but the request body has been consumed by the servlet or a servlet filter accessing the request parameters. Only resource methods using @FormParam will work as expected. Resource methods consuming the request body by other means will not work as expected.

Seen anything like this with it before? We're running JIRA 5.1.4

0 votes
Bill Wonch August 6, 2013

We're running 5.1.4 - any suggestions on a javascript implementation? Say I need to load the list from a file.

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.
August 6, 2013

That's a cascading select field, if you want the built-in route.

Some sites have different requirements and do this with javascript, which can work well, but is a little tricky in later versions of Jira

Bill Wonch August 6, 2013

Sorry meant that as a comment...

We're running 5.1.4 - any suggestions on a javascript implementation? Say I need to load the list from a file.

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.
August 6, 2013

I have to wave the "out of my depth" flag. I know javascript can do it, and that in later versions of Jira, you can struggle because you've got four ways to create issues, all slightly different etc, but my javascript is not strong enough to provide you with any real help.

I'd search answers for the word "javascript" - a good chunk of the questions here are about manipulating Jira fields with it.

Suggest an answer

Log in or Sign up to answer