Arthur
Arthur

Reputation: 151

How to get job parameter by Groovy Script in post build

My project is a work-flow control system, and the Jenkins is responsible for build phase. After building successfully, Jenkins would trigger another servlet to do following work and pass a job parameter(processSN) to the servlet.

I set a parameter(processSN) as I trigger this job by its token. And hope to pass the parameter to servlet as building successfully.

The example I find, always show the "default" parameter but what I expect is the input parameter as I trigger the job https://wiki.jenkins-ci.org/display/JENKINS/Display+job+parameters

How could I get the input parameter(processSN) by groovy script in post build phase ?

Upvotes: 1

Views: 6812

Answers (1)

sschuberth
sschuberth

Reputation: 29866

According to the docs for the Groovy Postbuild Plugin you should use:

manager.build.buildVariables.get("processSN")

Upvotes: 3

Related Questions