-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor
-
Component/s: pipeline-utility-steps-plugin
-
None
In the following pipeline, I would expect that appending the variable `y` to `jsonArray` would be the same regardless if it is a Java String or a GString. Right now, I'm must call `.toString()` before appending.
Â
```
pipeline {
 agent any
 stages {
   stage('Test') {
     steps {
       script {
         def x = "x"
         def y = "${x}"
         def jsonArray = readJSON text: '[]'
         jsonArray << x
         jsonArray << y
         println(jsonArray)
       }
     }
   }
 }
}
```
Actual output:
```
["x",
]
```
Expected output:
```
["x","x"]
```
Â
Â
Â