Run-time parameters in buildFinished event

Hi,
I'm trying to get run-time parameters passed to build by http request (something like /httpAuth/action.html?add2Queue=bt2&name=MY_PARAM&value=MY_VALUE)
Both getAvailableParameters() and getDefinedParameters() don't return user-specified parameters:

void buildFinished(SRunningBuild sRunningBuild) {
  sRunningBuild.getAgent().getAvailableParameters();
  sRunningBuild.getAgent().getDefinedParameters();
}

Is there any way to get them?
Thanks!

1 comment
Comment actions Permalink

Hello,

You are trying to access build agent parameters. On Agent there are 3 parameter scopes. Agent - global, per Build and per Step parameters.
For more details, take a look at http://blog.jonnyzzz.name/2011/07/agent-parameters-story.html

Do access build parameters you may do the following:

SRunningBuild build;
build.getParameterProvider().get("MY_VALUE");

0

Please sign in to leave a comment.