Forums

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

How to display dynamic fields based on jira Custom field Cascading field type(Using Parent values)?

Varun Nelluri April 29, 2020

We are using script runner and i have create few behaviours for Single select or multi select dropdown fields to display dynamic fields.

I am not sure how groovy script works with Cascading field, Could you please some one help me how to display dynamic fields based on Cascading field primary values(Groovy code much appreciated).

 

Below is the sample  groovy code i have written to  display dynamic fields(Drop Down (Single))  on Field:

def ProblemCodeFieldValue = ProblemCodeField.getValue()

if (ProblemCodeFieldValue == "x") {

CallSamplesField.setHidden(false)
AccountNumberField.setHidden(true)
}

if (ProblemCodeFieldValue == "XX") {

CallSamplesField.setHidden(true)
AccountNumberField.setHidden(false)
}

if (ProblemCodeFieldValue == "XXX") {

CallSamplesField.setHidden(true)
AccountNumberField.setHidden(true)
}

if (ProblemCodeFieldValue == "XXXX") {

CallSamplesField.setHidden(false)
AccountNumberField.setHidden(false)
}

Joshua Yamdogo @ Adaptavist , @Jenna Davis , I see all of you solved a couple of similar behaviours questions before, could you possibly help me with this one please?

 

Thanks 

1 answer

0 votes
Andre Serrano
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.
May 6, 2020

Hi Varun,

have you checked Adaptavist Library website?

https://library.adaptavist.com/

It's a library of groovy scripts that you can use on your ScriptRunner.
I was checking there and I think this script can help you getting where you want:

https://library.adaptavist.com/entity/set-behaviour-multi-and-single-select-options-and-value

Varun Nelluri May 6, 2020

@Andre Serrano , I did but i couldn't find the dynamic fields display based on the Cascading field values.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events