Forums

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

Populate a field based on another field's option

Anusha Iyer April 11, 2022

Hi

Could you please help me to keep a field available with other field's value?

Only when  user set the Automation Status as Automated, Test Cases Reference will be shown below the Automation Status.

Thanks,
Anusha

image-2022-04-08-18-39-19-119.png

 

2 answers

0 votes
Teja
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.
April 18, 2022

Hi @Anusha Iyer 

I guess you're using wrong syntax for custom field ID, it should be customfield_14781

def automationStatusField = getFieldById("customfield_XXXXX") //Automation Status field
def automationStatusFieldType = automationStatusField.getValue()

def testCaseReferenceField = getFieldById("customfield_14781") // TestCase Reference field

if(automationStatusFieldType == "Automated"){
testCaseReferenceField.setReadOnly(true);
}
else{
testCaseReferenceField.setReadOnly(false);
}

Please change customfield_XXXX to your Automaton Status cf ID.

Please try this code adding in behavior script and under Automation Status field.

Regards
Tej

0 votes
Anusha Iyer April 11, 2022

I tried below script but nothing worked

 

def automationStatusField = getFieldById(getFieldChanged())
def testCaseReferenceField = getFieldById("customFieldId=14781")

String automationStatusVal = automationStatusField.getFormValue();

if(automationStatusVal.equals("Automated")){
testCaseReferenceField.setReadOnly(true);
} else {
testCaseReferenceField.setReadOnly(false);
}

Suggest an answer

Log in or Sign up to answer