Hi everyone,
When I create an issue I add a select list custom field. Depending the user selected option I need extra information so I need show different custom field (with diferent field types). I find documentation that explains how using javascript on the description custom fields you can hide it but the associated label is showed always on my jira version (5.2.11).
There any way to do this? I think about other solutions but i don't know if exists any. For example, Can I show automaticatly other screen after creation (configuring which screen depending the option selecten on custom field) and put in this more custom fields related with the first one?
Thanks
Hi,
try the script below, this is exactly how we use it, just replace the customfield with the correct value
<script type="text/javascript"> function selectedCorrectItem(){ var controlCustomField = document.getElementById('customfield_10000'); for (x=0;x<controlCustomField.length;x++){ if (controlCustomField.options[x].selected) { if (controlCustomField[x].value == 'id_value'){ return true; } } } return false; } controlCustomField = document.getElementById('customfield_10000'); toHideCustomField = document.getElementById('customfield_10001'); controlCustomField.onchange=function() { if (selectedCorrectItem()) { toHideCustomField.parentNode.style.display=''; } else { toHideCustomField.value =''; toHideCustomField.parentNode.style.display='none'; } } </script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Natalia,
Could setting different screen schemes with different issue types work to suit your requirements? You can check out more about Issue Type Screen Schemes here - Associating Screen and Issue Operation Mappings with an Issue Type
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i read it when i was thinking how to do this. The problem is that for each issue type i need a list of "standard requests" for my project (a list). Some of the options on this "standard requests" need different extra information.. for example for the option A I need to fill a text field, for the option B I need to show a select list, etc.
Any suggestion how i can do this,
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Javascript is not recommended, but I think you forgot to install a node, parent node to hide the div Which Contain label and value.
can you post your script or an example?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i know that javascript is not recomended but i don't find other way to do this after readind documentations and searchin on answers.
Here an example that when I chose one priority option I show a custom field that works but the label of the custom field is always showed:
<script type="text/javascript">
priority = document.getElementById('priority');
if (priority) {
target2 = document.getElementById('customfield_11001');
if (priority.value != 2) target2.style.display='none';
priority.onchange=function() {
if (this.value == 2) {
target2.style.display = '';
target2.value="enter message here for field camp11";
} else {
target2.style.display='none';
}
}
}
</script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try this script
<script type="text/javascript"> AJS.$(document).bind('dialogContentReady', function(event, dialog) { priority = AJS.$('#priority'); target2=AJS.$('#customfield_11001'); if(priority.length>0){ if(priority.val!=2){ target2.closest('div.field-group').hide(); } priority.change( function(){ if(priority.val()==2){ target2.closest('div.field-group').show(); target2.val('enter message here for field camp11'); } else{ target2.closest('div.field-group').hide(); target2.val('') } } ); } }); </script>
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.
Hi, what is the error ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nataila,
Not sure if it would help. But try the suggetion in link below.
http://stackoverflow.com/questions/17233782/how-to-create-cascade-multiple-select-list-custom-field
Vijay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks but i think i doesn't work because in some cases when I choose an option from the first select I need 3 or 4 custom text field, but selectin other option maybe I nedd another select list.
The custom fieds need depend which select option you choose.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.