The following fails in pipeline scripts (the if statement always evaluates to false)

      def getStatus(){
       // ....
       "Ready"
      }
      
      //....
      
      
      def acceptedStatuses = ["Ready", "Updated", "Failed" ]
      def status
      if(acceptedStatuses.contains((status = getStatus()))){
         // never called
      }
      
      
      

          [JENKINS-41422] Assignment in if statements does not work

          Zhelyan Panchev created issue -
          Zhelyan Panchev made changes -
          Epic Link New: JENKINS-35390 [ 171183 ]
          Andrew Bayer made changes -
          Component/s New: workflow-cps-plugin [ 21713 ]
          Component/s Original: pipeline [ 21692 ]
          Andrew Bayer made changes -
          Labels Original: pipeline New: complex-cps-code pipeline triaged-2018-11

            Unassigned Unassigned
            zhelyan Zhelyan Panchev
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: