Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-64292

Persistent Plugin doesn't work with declarative pipelines

    XMLWordPrintable

Details

    Description

      I am creating Pipeline job and adding one Persistent String Parameter to it, then just printing the parameter in the declarative pipeline stages.
      Expecting on every build the persistent string parameter to keep the value, with which it was called on the previous build, but eventually it is empty after the first build is done.

      How to reproduce:

       

      Here is simple PIPELINE code, which is reproducing the issue:

      pipeline {
          agent any

          environment {
              TEST = "${params.test}"
          }

          stages {
              stage('TEST') {
                  steps {echo TEST}
              }

          }
      }

      NOTE: The Persistent String parameter is working fine on Freestyle jobs!

      Attachments

        Activity

          gterziev Georgi Terziev created issue -
          gterziev Georgi Terziev made changes -
          Field Original Value New Value
          Priority Minor [ 4 ] Major [ 3 ]
          gterziev Georgi Terziev made changes -
          Description I am creating Pipeline job and adding one Persistent String Parameter to it, then just printing the parameter in the declarative pipeline stages.
          Expecting on every build the persistent string parameter to keep the value, with which it was called on the previous build, but eventually it is empty after the first build is done.

          How to reproduce:

          !image-2020-11-23-16-15-31-585.png!

           

          Here is simple PIPELINE code, which is reproducing the issue:


          {quote}pipeline {
              agent any

              environment {
                  TEST = "${params.test}"
              }

              stages {
                  stage('TEST') {
                      steps {
                          sh """
                              echo $TEST
                          """
                      }
                  }
              }
          }
          {quote}
          NOTE: The Persistent String parameter is working fine on Freestyle jobs!
          I am creating Pipeline job and adding one Persistent String Parameter to it, then just printing the parameter in the declarative pipeline stages.
           Expecting on every build the persistent string parameter to keep the value, with which it was called on the previous build, but eventually it is empty after the first build is done.

          How to reproduce:

          !image-2020-11-23-16-15-31-585.png!

           

          Here is simple PIPELINE code, which is reproducing the issue:
          {quote}pipeline {
               agent any

              environment {
                   TEST = "${params.test}"
               }

              stages {
                   stage('TEST') {
                       steps {
                           sh """
                               echo $TEST
                          """            
                      }

                  }
               }
           }
          {quote}
          NOTE: The Persistent String parameter is working fine on Freestyle jobs!
          gterziev Georgi Terziev made changes -
          Description I am creating Pipeline job and adding one Persistent String Parameter to it, then just printing the parameter in the declarative pipeline stages.
           Expecting on every build the persistent string parameter to keep the value, with which it was called on the previous build, but eventually it is empty after the first build is done.

          How to reproduce:

          !image-2020-11-23-16-15-31-585.png!

           

          Here is simple PIPELINE code, which is reproducing the issue:
          {quote}pipeline {
               agent any

              environment {
                   TEST = "${params.test}"
               }

              stages {
                   stage('TEST') {
                       steps {
                           sh """
                               echo $TEST
                          """            
                      }

                  }
               }
           }
          {quote}
          NOTE: The Persistent String parameter is working fine on Freestyle jobs!
          I am creating Pipeline job and adding one Persistent String Parameter to it, then just printing the parameter in the declarative pipeline stages.
           Expecting on every build the persistent string parameter to keep the value, with which it was called on the previous build, but eventually it is empty after the first build is done.

          How to reproduce:

          !image-2020-11-23-16-15-31-585.png!

           

          Here is simple PIPELINE code, which is reproducing the issue:
          {quote}pipeline {
               agent any

              environment {
                   TEST = "${params.test}"
               }

              stages {
                   stage('TEST') {
                       steps {
                          echo TEST
                      }
                  }
               }
           }{quote}
          NOTE: The Persistent String parameter is working fine on Freestyle jobs!
          gterziev Georgi Terziev made changes -
          Description I am creating Pipeline job and adding one Persistent String Parameter to it, then just printing the parameter in the declarative pipeline stages.
           Expecting on every build the persistent string parameter to keep the value, with which it was called on the previous build, but eventually it is empty after the first build is done.

          How to reproduce:

          !image-2020-11-23-16-15-31-585.png!

           

          Here is simple PIPELINE code, which is reproducing the issue:
          {quote}pipeline {
               agent any

              environment {
                   TEST = "${params.test}"
               }

              stages {
                   stage('TEST') {
                       steps {
                          echo TEST
                      }
                  }
               }
           }{quote}
          NOTE: The Persistent String parameter is working fine on Freestyle jobs!
          I am creating Pipeline job and adding one Persistent String Parameter to it, then just printing the parameter in the declarative pipeline stages.
           Expecting on every build the persistent string parameter to keep the value, with which it was called on the previous build, but eventually it is empty after the first build is done.

          How to reproduce:

          !image-2020-11-23-16-15-31-585.png!

           

          Here is simple PIPELINE code, which is reproducing the issue:

          {color:#de350b}pipeline {{color}
          {color:#de350b}     agent any{color}

          {color:#de350b}    environment {{color}
          {color:#de350b}         TEST = "${params.test}"{color}
          {color:#de350b}     }{color}

          {color:#de350b}    stages {{color}
          {color:#de350b}         stage('TEST') {{color}
          {color:#de350b}             steps \{echo TEST}
                  }{color}
          {color:#de350b}     }{color}
          {color:#de350b} }{color}

          NOTE: The Persistent String parameter is working fine on Freestyle jobs!

          People

            greg2001 Gregory Moltchadski
            gterziev Georgi Terziev
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: