Groovy Code for triggering a build with a parameter
def params = 
[
    new StringParameterValue('UPSTREAM_TRIGGER_CAUSE', 'true')
]
def paramsAction = new ParametersAction(params)

def cause = new UpstreamCause(build)
def futureTask = project.scheduleBuild2(project.quietPeriod, cause, 
paramsAction)

I have configured parameters for each projects with default values. When I 
supply this one extra parameter with scheduleBuild2 the other configured 
parameters are not set. Thus getting:

 > git rev-parse ${BUILD_BRANCH}^{commit} # timeout=10
ERROR: Couldn't find any revision to build. Verify the repository and branch 
configuration for this job.


I reckon I have to first get the configured parameters from the project, 
then add the new one. 
Just not sure how. I can read the properties with
def property = project.getProperty(ParametersDefinitionProperty.class)
But that will not give me a map of key/value for each property.


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6ff0dd20-dff9-4215-bbab-1176210d81fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to