Hello everyone,
I have 4 custom single select fields "Region", "Market A", "Market B", and "Market C".
I would like to hide the custom single select fields of "Market A", "Market B", and "Market C" based upon the value I select within the "Region" custom field. (I need to do this without any paid for plug-ins like script runner)
IE: If within "Region" I select the value of 'Region 1', I'd only like "Market A" to show up, and have the other Market custom fields be hidden.
Right now I'm trying to tweak a script I found within the atlassian documentation without any luck; and I believe I'm missing something since these are all custom fields and not a combo of custom and jira system fields.
Here is my coding so far:
JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function(e, context) { console.log("new content added")
<script type="text/javascript">
region = document.getElementById('region');
if (region) {
target = document.getElementById('customfield_10200');
// Hide the target field if Region isn't "Market 1"
if (region.value != 1) target.style.display='none';
priority.onchange=function() {
if (this.value == 1) {
target.style.display = '';
target.value='Value 1';
} else {
target.style.display='none';
}
}
}
</script>
Any help would be greatly apperciated!
Thanks,
Michael
Hi again everyone,
I was able to do this via Javascript within the description field of both the custom field itself as well as within the field configuration screen. I forgot to add some tweaked code to that screen; which made it not work.
Thanks,
~Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hiding a field based on other field value can be done using Script runner behaviors.
Please let me know where you are writing this code.
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.