Javascript in JIRA : set values to fields according value specified in a listbox

Hi all,

I wonder if it was possible to set values to fields according the value you choose in a listbox.

Example :

I've got a listbox list1, another one list2 and a textbox text1.

  • list1 contains 'value1', 'value2' and 'value3'
  • list2 contains 'valueA', 'valueB' and 'valueC'
  • text1 is empty

Is this possible to write a simple little script to command the display of both list2 and text1 according to the value selected in list1 : for example, if I choos 'value1' in list1, I would like to have 'valueB' automatically selected in list2 and text1 filled with 'value1' ?

Have you ever write a such script ? could you forward me to help ?

Thanks a lot,


4 answers

1 accepted

1 vote
Accepted answer


again i am giving solution :)

i suggest to load javascript as webresource module in aplugin

check this for reference

<script type="text/javascript"> 
jQuery(document).ready(function($) { 
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) { 
function callHideShowFunction(){
	//list1 onchange		
    $('#customfield_10903').change(function() { 
function showHideSelectList(){ 
		//list1 field
    var firstListValue=$.trim($("#customfield_10903 :selected").text()); 
		//list2 field
		//text box
    if( firstListValue == "Yes" ){       
		//select list 2 field value
		$("#customfield_10902 option").each(function() {
			if($(this).text() == 'valueB') {
				$(this).attr('selected', 'selected');            
		//set text box value with list1 selected value(here i am adding selected text not option id)
    }else {      
		//before hiding clearing field

i hope atleast it will work as you expected!!

1 vote
Daryl Chuah Atlassian Team Sep 16, 2013

Hi Chris

I believe script runner plugin will be able to help you on this. You may check with the plugin vendor, Jamie Echlin regarding on this.

Hopefully it helps cheers :)

But it is in a same issue screen (when I create an issue).... not in the workflow, using transitions...

Hi.  how I will do  for user session 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Wednesday in Jira

Make your Atlassian Cloud products more secure: our NEW admin security guide

Hey admins! I’m Dave, Principal Product Manager here at Atlassian working on our cloud platform and security products. Cloud security is a moving target. As you adopt more products, employees consta...

45 views 0 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you