Forums

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

Display field based on other field

lastminute.com July 4, 2019

Hi all,

I'm looking for a way to display a field based on another field selection while creating a ticket in Jira.

I found this how-to, but I have some doubts

https://confluence.atlassian.com/jirakb/how-to-display-a-field-based-on-another-field-s-selection-649921383.html

 

------------------------------------------------------------------------------

 

First of all: I didn't find a custom field called "Free Text Field (unlimited text)".

Should I use a "Calculated Text Field", a "Text Field (multi-line)" or another field type?

 

------------------------------------------------------------------------------

 

Speaking about the formula: imagine I have a FIELD A called "priority" (id 500) that will cause a FIELD B called "time" (id 600) to show up if the FIELD A has a value of "2".

 

Checking row by row in the link above:

priority = document.getElementById('priority') ---> this is FIELD A, right?

target = document.getElementById('customfield_10000'); ---> this is FIELD B, right? So I should write my field id "('customfield_600')"

 

Why "if (priority.value != 2) target.style.display='none'" needs to be specified

if after there's an "if - else" condition in place?

priority.onchange=function() {
if (this.value == 2) {
target.style.display = '';
target.value="enter message here";
} else {
target.style.display='none';
}

 

------------------------------------------------------------------------------

 

I hope you'll be able to clarify my doubts.

Thank you,

Marco.

2 answers

1 accepted

0 votes
Answer accepted
lastminute.com July 12, 2019

Fount it!

<<priority = document.getElementById('priority')>> needs the id and not the name as in the example I found in the documentation.

Ops
Contributor
May 28, 2020

<deleted>

0 votes
lastminute.com July 9, 2019

Hello,

any suggestions on that?

 

Thank you,

Marco.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events