groovyjenkinshudsonjenkins-plugins

How to remember parameter values used on last build in Jenkins/Hudson


I need to remember the last parameter values when I begin a new build with parameters.

I have two string parameters:

${BRANCH}
${ServerSpecified}

On the first build execution I need those values in blank, but for the second execution, I need the values of the first execution, in the third execution the values of the second execution, and so on...

Do I need to install a plugin? I have tried using dynamic param with groovy, but I can't extract the last value. Does anybody know how to do this or have any other idea?


Solution

  • Yes, it looks like you are trying to invent something like Version Number Plugin:

    This plugin creates a new version number and stores it in the environment variable whose name you specify in the configuration.

    So you can as many variables as you want.