Custom fields based on a select list

Ian Van Xanten September 23, 2019

Hi all.

I want to show a custom field when they select a choice in a select list.

For example: A select list with YES or NO, if you select YES show a custom field to explain why you choose yes

How can I do it?

Thanks!

2 answers

1 accepted

1 vote
Answer accepted
Leo
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 23, 2019

Hi @Ian Van Xanten,

 

I'm not sure about hide/display fields but you can enable/disable custom fields based on another field selection using simple javascript something like below. 

below script will enable/disable one of the custom field based on the priority value selection

NOTE: you must place this script in the custom field's(Field B) description

 

<script type="text/javascript">
  priority = document.getElementById('priority');
  if (priority) {
      target = document.getElementById('customfield_10000');
      // Hide the target field if priority isn't critical
      if (priority.value != 2) target.style.display='none';
 
      priority.onchange=function() {
          if (this.value == 2) {              
                     target.style.display = '';  
                     target.value="enter message here";
                  } else {
                 target.style.display='none';
          }
      }
  }
 </script>

 

BR,

Leo

Ian Van Xanten September 24, 2019

Thanks @Leo 

0 votes
Avinash Bhagawati _Appfire_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 23, 2019

Hi @Ian Van Xanten ,

 

With help of Dynamic Forms for Jira  app you will create dynamic fields and helps to display Display only context-relevant fields to users.

Thanks,

Avinash

Suggest an answer

Log in or Sign up to answer