How to make one custom fields drop values dependent on another custom fields selected value

Arijit Banerjee July 1, 2014

I have a single select custom field with some dropdown values.Now I want another custom field(Single select) whoes drop down dispaly list change with the change in value of the first field.

How do i achive it?

Thanks in advance.

3 answers

1 accepted

3 votes
Answer accepted
Marcus Silveira
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 1, 2014

Have you tried using a cascading custom field, Arjit?

If that doesn't fulfil your requirement, maybe a javascript to only shows specific values depending on the value of another field.

Maybe this can help

https://confluence.atlassian.com/display/JIRA/Displaying+a+Field+Based+on+Another+Field+Selection

Arijit Banerjee July 1, 2014

Hi Marcus,

I have tried to use cascading filed but the problem is I could not name the second field.Also I have to read the data from second field to be used somwhere else.

How to achieve tthese two conditions?

Vijay Khacharia
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.
July 1, 2014

I think it sums up the requirement. Cascade select list can be an option

0 votes
Ruth Ariel January 1, 2020

Hi @Vijay Khacharia ,

I want to make one custom field drop values dependent on another locked field (Organizations).

I understand that I cant use the Cascaded custom field.

Is it possible to use the code you wrote above?

If yes I will thank you If you can explain me where and how I write this code.

Thanks!

Ruth

Vijay Khacharia
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.
January 1, 2020

I am not sure about what you mean by locked field. The code I had put in the description field of the custom field definition. But I see this thread that says it might not work with newer versions of JIRA.

https://community.atlassian.com/t5/Jira-questions/JavaScript-on-Custom-Field-Description-of-JIRA-6-4/qaq-p/322326

Ruth Ariel January 8, 2020

OK. Thank you!

Kathi Paquet
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.
April 16, 2021

Yes I have the same use case.  User wants to selection Location and than based off that display specific Hardware options and specific Software options.  So it is like a 3 cascading list versus 2.  Any thoughts on how to achieve this on the Cloud?

Like # people like this
0 votes
Vijay Khacharia
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.
July 1, 2014

Hi,

Can you try the solution below.

<script type="text/javascript">
  source = document.getElementById('customfield_13355');
  if (source) {
      target = document.getElementById('customfield_13750');
      source.onchange=function() {
          if (this.value == 12720) {
                     target.value=12735;
                  }
      }
  }
 </script>

You need to change the customfield ids and the ids of the selection items.

Vijay

Arijit Banerjee July 1, 2014

I will explain properly:

Consider i have 4 dropdown value(A,B,C,D) for my 1st field and 10 dropdown(0,1,2,3,4,5,6,7,8,9) value for my 2nd.Now if if I select A from first field Second field should show me 1,4,6,8 out of which I cna select any particular. Simalrly for other values also same funcationality applies

Vijay Khacharia
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.
July 1, 2014

Then the option you have is to have Cascaded select list custom field.

This gives you option on what are the dependencies between two select lists.

Vijay

Like Meeta Broca likes this
Arijit Banerjee July 2, 2014

Thanks Vijay and Marcus your inputs helped

Arijit

Venki Thyagarajan September 24, 2015

Hi Arijit, We have a similar requirement and wondering how you implemented this? Can you please explain. Thanks, Venki.

Asha.Ahirwar December 29, 2017

Hi Arijit,

You need to create custom field as Cascaded selecting.Then you can select multiple values using two select list.

Asha

Huy Nguyen July 16, 2019

Hi Arijit, I have the same question and problem, can you explain please? Thanks. Contact me via nld.huy01@gmail.com pls

Suggest an answer

Log in or Sign up to answer