Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,551,873
Community Members
 
Community Events
184
Community Groups

Show 2 Fields based on Another field

Ray Navarro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Mar 27, 2023

Hi Experts,

 

I'm trying to show a custom field twice in a form. 

 

Custom field1 is "Entity" (single-choice)

Field2 is, "Is this for another Entity?" (single-choice)

Then show the "Entity" field again on the screen.

Is there a way to this?

 

I'm using scriptrunner but it only works for a single field. Can I set this up to show the same field until the reporter selects No?

 

def cfA = getFieldById("customfield_ID1") 
def cfB = getFieldById("customfield_ID2")
cfA.setHidden(false)

if (cfB.value == "No"){
cfA.setHidden(true)
cfA.setRequired(false)
}
else {
cfB.setHidden(false)
cfC.setRequired(true)
}

2 answers

1 accepted

0 votes
Answer accepted
Oday Rafeh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Mar 28, 2023

Hi @Ray Navarro , Welcome

You can try to add a third field called "Show Entity" which will be hidden or shown based on the value of the "Is this for another Entity? " field. If "Yes" is selected, the "Show Entity" field will be shown which is a duplicate of the "Entity" field. Otherwise, the "Show Entity" field will be hidden.

def cfEntity = getFieldByName("Entity")
def cfAnotherEntity = getFieldByName("Is this for another Entity?")
def cfShowEntity = getFieldByName("Show Entity")

cfEntity.setHidden(false)
cfAnotherEntity.setHidden(false)
cfShowEntity.setHidden(true)

if (cfAnotherEntity.getValue() == "Yes") {
cfShowEntity.setHidden(false)
} else {
cfShowEntity.setHidden(true)
}
Ray Navarro
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Mar 29, 2023

Thanks! It looks like we need to create a separate field. I found my way thru checkbox field. 

Like Oday Rafeh likes this
0 votes
Alex Koxaras _Relational_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Mar 28, 2023

Hi @Ray Navarro and welcome to the community,

No, it's not possible to show the same field twice on a screen. May I ask what is it you want to achieve by showing the same field twice?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events