Forums

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

When we select dropdown single select list custom field, we need help to remove any error

Vijay dumpala May 31, 2023

We have a requirement based on 4 Single select choice custom fields like A, B, C and D.

When we select A among some values, then  B, C and D should be updated as "Not Applicable". I did some coding but when select drop down list it shows list of values ​​in red color.

Can you please help with this.

1 answer

0 votes
Fabio Racobaldo _Catworkx_
Community Champion
May 31, 2023

Hi @Vijay dumpala ,

you can't do that using builtin feature. You could use a behaviour provided by Script Runner app (https://marketplace.atlassian.com/apps/6820/scriptrunner-for-jira?tab=overview&hosting=datacenter)

Fabio

Vijay dumpala May 31, 2023

Hi Fabio,

I know this, i used behaviour only, but still get the error.

Do you have any example scripts.

 

Thanks,

Vijay

Fabio Racobaldo _Catworkx_
Community Champion
May 31, 2023

Hey @Vijay dumpala ,

please put the following code to FieldA in your behaviour :

 

def fieldA = getFieldByName("Field A Name")

def fieldB = getFieldByName("Field B Name")

def fieldC = getFieldByName("Field C Name")

def fieldD = getFieldByName("Field D Name")

String fieldAValue = fieldA.getValue();

if("VALUE A".equalsIgnoreCase(fieldAValue)){

    fieldB.setFormValue("Not Applicable");

    fieldB.setReadOnly(true);

    fieldC.setFormValue("Not Applicable");
    fieldC.setReadOnly(true);
    fieldD.setFormValue("Not Applicable");
    fieldD.setReadOnly(true);


} else {

    fieldB.setFormValue("None");

    fieldB.setReadOnly(false);
    fieldC.setFormValue("None");

    fieldC.setReadOnly(false);
    fieldD.setFormValue("None");

    fieldD.setReadOnly(false);
}
Obviously update script based on your field name and values. "Not Applicable" should be an option for fields B,C and D
Fabio

Suggest an answer

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

Atlassian Community Events