1

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 ?

Arthur
  • 151
  • 2
  • 11
  • 1
    http://stackoverflow.com/questions/10882515/how-to-retrieve-jenkins-build-parameters-using-the-groovy-api – Jayan Oct 21 '13 at 05:05
  • Thanks @Jayan . I read that before, but can't understand how to implement... . Thanks anyway. – Arthur Oct 21 '13 at 05:21
  • Let us know what you don't understand. I would suggest following the link of the accepted answer and make yourself familiar with the Jenkins API. – Peter Schuetze Oct 21 '13 at 15:53

1 Answers1

3

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

manager.build.buildVariables.get("processSN")
sschuberth
  • 28,386
  • 6
  • 101
  • 146