Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Populate a field based on another field's content in Jira server

Ops
Contributor
June 8, 2020

Hi All! I have tried Atlassian Support with this question but they have suggested I ask the community as this is a customization.

I would like a field to display based on the value of a radio button field. Think of it like this: Field A (radio button) - "More info required: Yes/No". Field B (free text) - "Enter more information". Field B will display if Field A is "Yes" but will be hidden if it is "No"

I have followed the script provided in this KB and I can get the script working where Field A is a drop down. See my commented code to help me understand how it works:

<script type="text/javascript">
// Set the query field to lookup the value of here
query = document.getElementById('customfield_10000');
if (query) {
// Set the target field to show or hide based on the query field here
target = document.getElementById('customfield_14282');

// Hide the target field unless the query value already matches
// what you want it to be
if (query.value != 17830) target.style.display='none';

// On change, show the target field if query value matches
// what you want it to be else hide it
query.onchange=function() {
if (this.value == 17830) {
target.style.display='';
// Show some placeholder text, if you want
// target.value="Enter something here!";
} else {
target.style.display='none';
}
}
}
</script>

Can any one assist with a way to read the value of a radio button field? They seem to respond differently to a drop down.

Many thanks,

Matthew

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events