Skip to content

Instantly share code, notes, and snippets.

@sdh7
Created December 2, 2021 21:50
Show Gist options
  • Save sdh7/8ac071d5c169554d1315c6cc60e76d58 to your computer and use it in GitHub Desktop.
Save sdh7/8ac071d5c169554d1315c6cc60e76d58 to your computer and use it in GitHub Desktop.
import groovy.json.JsonSlurper
jsonSlurper = new JsonSlurper()
offCampusAddress = jsonSlurper.parseText(cwruEduPersonOffCampusOfficeAddressJson)
localAddress = jsonSlurper.parseText(cwruEduPersonLocalAddressJson)
log.info("offCampusAddress={}, localAddress={}", offCampusAddress, localAddress);
if (!cwruEduSuppressionAddress){
if(offCampusAddress?.getAt('postalCode')){
offCampusAddress.getAt('postalCode');
} else {
if (localAddress?.getAt('postalCode')){
localAddress.getAt('postalCode');
}
}
} else {
if (offCampusAddress?.getAt('postalCode') && (!cwruEduSuppressionAddress.contains('OFFCAMPUS'))){
offCampusAddress.getAt('postalCode');
} else {
if (localAddress.getAt('postalCode') && (!cwruEduSuppressionAddress.contains('LOCAL'))){
localAddress.getAt('postalCode')
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment