Created
December 2, 2021 21:50
-
-
Save sdh7/8ac071d5c169554d1315c6cc60e76d58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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