HI Team,
i wanted to fetch the radio button custom field value and on the basis of custom field values, i want to set this to another custom field value.
def customFields = get("/rest/api/2/field")
.asObject(List)
.body
.findAll { (it as Map).custom } as List<Map>
def newSQL = customFields.find { it.name == 'custom_field 1' }?.id
def newUser = customFields.find { it.name == 'customf_field 2' }?.id
def newLibrary = customFields.find { it.name == 'custom_field 3' }?.id
//def vaRequired = customFields.find { it.name == 'custom field 4' }?.id
def newSQLFieldValue = issue.fields[newSQL] as String
def newUserFieldValue = issue.fields[newUser] as String
def newLibraryFieldValue = issue.fields[newLibrary] as String
if(newSQLFieldValue != null && newUserFieldValue != null && newLibraryFieldValue != null){
logger.info(" New SQL " + newSQLFieldValue + " New User " + newUserFieldValue + " New Libraby " + newLibraryFieldValue)
if(newSQLFieldValue.equalsIgnoreCase('yes') && newUserFieldValue.equalsIgnoreCase('yes') && newLibraryFieldValue.equalsIgnoreCase('yes')){
//here if all the three field values are "Yes"/"No" then this values should be set accordingly to Custom_field 4.
}
}
Right now I'm getting the three custom field values but while checking within the condition it fails.