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 edited

<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
atlassian, team ’25 europe, virtual access, catch team 25 virtually, anytime anywhere, hybrid event, atlassian conference, atlassian learning, ai teamwork, remote attendance, digital access pass, keynote livestream, product announcements, community events

Register for free Team '25 Europe digital access

Get your free all-access digital pass and don’t miss groundbreaking announcements, brand new features and product updates, insight-packed sessions, and exclusive digital content.

Sign up
AUG Leaders

Upcoming Jira Events