How to make intake questions conditional?

Geoff Griffin
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!
November 18, 2024

I’d like to make the questions for my org’s JIRA intake conditional, based on the teams our customers indicate they need to work with. We’re not on the cloud version so I’m unable to use conditional logic, and believe I’ll need to use Script Runner.  I have a multi select question at the start of our intake named “Design Teams Required” and based on what I’ve researched, I believe I’ll need to add a script to each subsequent question where I search for the response to “design teams required” and then hide or display. However, I’ve been unable to get this to work so far. Can anyone share a sample script for this functionality? I’ve tried a number of sample scripts online + AI, and nothing has worked so far. 

1 answer

0 votes
BURAK BAL January 31, 2025

Hi Geoff,

I hope you have been already found a solution. But I believe that will help. Please check the code below.  You need to use it on Scriptrunner Bevahiours.

 


import com.atlassian.jira.component.ComponentAccessor
def cf_A = getFieldById('customfield_11111') // parent custom field
def cf_B = getFieldById('customfield_2222') // child optional custom field
cf_B.setHidden(true) // use to hide
if(cf_A.getValue().toString()=="XXX")
{
    cf_B.setHidden(false)
}

Suggest an answer

Log in or Sign up to answer