I have a jenkinsfile that's starting numerous other jobs in Jenkins. I have a list of common parameters that I'm passing down to each job.
def buildParams = [
string(name: 'JIRA_ID', value: params.JIRA_ID),
string(name: 'JOB_TYPE_FILTER', value: params.JOB_TYPE_FILTER),
booleanParam(name: 'REBUILD_ARTIFACTS', value: params.REBUILD_ARTIFACTS)
]
I need to remove one from the list above before passing it to some jobs. Attempts below are failing saying the field or method in buildParams doesn't exist. What is the structure?
List buildParamsReduced = []
buildParamsReduced = buildParams.findAll { it.key != 'REBUILD_ARTIFACTS'}
..
buildParamsReduced = buildParams.findAll { it.name != 'REBUILD_ARTIFACTS'}
..
for (buildParam in buildParams) {
// This .getName fails, so does // This .getKey, so does .key == or .name ==
if (!buildParam.getName().equals('REBUILD_ARTIFACTS')) {
buildParamsReduced += buildParam
}
}
}