jenkinsci / persistent-parameter-plugin

https://plugins.jenkins.io/persistent-parameter/
MIT License
7 stars 11 forks source link

Doesn't 'persist' with Jenkins 2.0 Pipeline #1

Closed james-masson closed 4 years ago

james-masson commented 7 years ago

Doesn't work in combination with Jenkins 2.0 Pipelines.

It functions as a parameter just fine, but the successful parameters are not remembered for the next job run.

ashu16815 commented 7 years ago

https://github.com/ashu16815/persistent-parameter-plugin You may use this

ashu16815 commented 7 years ago

Hi,

This issue is resolved.

Cheers, Ankit

dpreilan commented 7 years ago

fyi, I was continuing to have issues even with Ankit's changes. It turned out to be security related. I had to give anonymous user permission to read jobs. This allowed the plugin which runs as anonymous the ability the get data from Hudson.getInstance().getAllItems()

wangyoucao577 commented 6 years ago

Meet same issue with Jenkins Pipeline 2.5.

mbasri commented 6 years ago

+1

jhrabi commented 6 years ago

+1

DaleBetts commented 6 years ago

+1

anupshrestha commented 6 years ago

+1

jkroepke commented 6 years ago

I found a good workaround with Extended Choice Parameter.

On project configuration, use Extended Choice Parameter

Parameter Type: Text Box

Script type: Groovy Script

Groovy script (same for value and default value):

try {
  return jenkins.getItemByFullName(jobName).getLastBuild().getProperties()["environment"][parameterName]
} catch (all) {
  return defaultValue
}

Properties:

jobName=Folder/Deploy
parameterName=VERSION
defaultValue=1.0
pedrodelgado81 commented 6 years ago

Same problem :(

amritihealthlabs commented 5 years ago

issue still persists, the latest value of build not retained.

donhui commented 5 years ago

+1

1508zb commented 5 years ago

I found a good workaround with Extended Choice Parameter.

On project configuration, use Extended Choice Parameter

Parameter Type: Text Box

Script type: Groovy Script

Groovy script (same for value and default value):

try {
  return jenkins.getItemByFullName(jobName).getLastBuild().getProperties()["environment"][parameterName]
} catch (all) {
  return defaultValue
}

Properties:

jobName=Folder/Deploy
parameterName=VERSION
defaultValue=1.0

I found a good workaround with Extended Choice Parameter.

On project configuration, use Extended Choice Parameter

Parameter Type: Text Box

Script type: Groovy Script

Groovy script (same for value and default value):

try {
  return jenkins.getItemByFullName(jobName).getLastBuild().getProperties()["environment"][parameterName]
} catch (all) {
  return defaultValue
}

Properties:

jobName=Folder/Deploy
parameterName=VERSION
defaultValue=1.0

Hi! Can you describe your practice in more detail? Maybe you can give an example,thank you so much!