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

Eval.x returns after the first method

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • workflow-cps-plugin
    • None

      Executing the following code as pipeline script (in a global library or after allowing Eval.x in the Sandbox):

      class Test {
          String testeval() {
              return Eval.x(this, '"${x.a()}-${x.b()}-${x.c()}"')
          }
          String a() {
              return "a"
          }
          String b() {
              return "b"
          }
          String c() {
              return "c"
          }
      }
      echo new Test().testeval()
      

      prints only "a" instead of the expected "a-b-c"

            Unassigned Unassigned
            schulzha Hans Schulz
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: