I know that you can access build parameters directly in the Jenkins Workflow. I have a parameter called BRANCH_REVISION which I need to update so that a call to the xml api will show the new value instead of the original value. This is something I was doing 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, it appears that this does not work in Workflow since the build object is not accessible. Thanks in advance for any help!