I know that you can access build options directly in Jenkins Workflow. I have a BRANCH_REVISION parameter that I need to update so that the xml api call displays a new value instead of the original value. This is what I did in a non-workflow script using the following groovy snippet:
def currentParamActions = build.getAction(ParametersAction.class)
def currentParams = currentParamActions.getParameters()
currentParams.each() {
if ( it.name.equals("BRANCH_REVISION") ) {
newParams.add( new StringParameterValue("BRANCH_REVISION", newRevision ) )
}
else {
newParams.add( it )
}
}
build.actions.remove(currentParamActions)
new_param_actions = currentParamActions.createUpdated(newParams)
build.actions.add(new_param_actions)
However, this does not seem to work in Workflow because the assembly object is not available. Thanks in advance for your help!
source
share