The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Single select field in Jira

kayode.faith
Contributor
July 15, 2024

Hi all I have two single select fields.

Field A "Is color blue?"

  • Yes
  • No

if yes what shade of blue?

  • Light
  • Dark
  • I don't know

2nd field is hidden based and based on the selected answer of the first question, second question is shown.

if yes, then tell us what shade of blue.  I have this code working where the second question is freeform text, is this possible with two single select fields as it is not working for me.

 

if yes what shade of blue?

 

def requireCode = getFieldById(getFieldChanged())
def requireCodeValue = requireCode.getValue()

def codeLocation = getFieldByName("Duration of hold")

if ('Yes' in requireCodeValue) {
    codeLocation.setHidden(false)
    codeLocation.setRequired(true)
} else {
    codeLocation.setHidden(true)
    codeLocation.setRequired(false)
}
Thank you,
Kayode

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Shawn Doyle - ReleaseTEAM
Community Champion
July 15, 2024
kayode.faith
Contributor
July 16, 2024

Great and thank you Shawn.  That worked.   I would have preferred a pop up but your suggestion saved me a lot of time troubleshooting.

Like John Funk likes this
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events