Hello guys,
I have two custom fields in issue creation screen, 'Field A' and 'Field B'.
I need a way to populate 'Field B' automatically after the user inputs the value in 'Field A'.
I know this can be achieved with Javascript, but since my knowledge in the area is limited, is there a tutorial or any tips that can help out?
I need to develop a separate plugin or can I just add the Javascript as html in the customfield config?
Thanks for any insights on this issue.
Community moderators have prevented the ability to post new answers.
Done:
<script type="text/javascript"> input = document.getElementById('customfield_12301'); if (input) { target = document.getElementById('customfield_12300'); input.onchange=function() { if (input.value == 11705) { var valor = 11700; target.value = valor; } } } </script>
Hi Ariel,
is that also working with many fields? let say Field A will be populated when data has been inputted in Field B,C,D,E & F? Field A = summary details of fields B,C,D,E&F (this will be shown as the header of the whole).
thanks,
Khel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm trying something like:
<script type="text/javascript"> jQuery(document).ready( function($) { JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e,context) { setFieldValues(); }); setFieldValues(); function setFieldValues(){ output = document.getElementById('customfield_12301'); if (output) { target = document.getElementById('customfield_12300'); output.onchange=function() { if (output.value == 11705) { var valor = 11700; setValue(target,valor); } } } } function setValue(field,value){ $(field+" option").each(function() { if($(this).text() == value) { $(this).attr('selected', 'selected'); } }); } }); </script>
but i keep getting the following error:
Uncaught Error: Syntax error, unrecognized expression: [object HTMLSelectElement]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ariel,
is that also working with many fields? let say Field A will be populated when data has been inputted in Field B,C,D,E & F? Field A = summary details of fields B,C,D,E&F (this will be shown as the header of the whole).
thanks,
Khel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.