-
Bug
-
Resolution: Unresolved
-
Minor
-
None
Using closures in a declarative step skips the step without any message.
I would expect the closures to work, but at least an error would be nice.
Steps to reproduce
- Create Pipeline project
- Paste pipeline script
def wrapme = {String s -> "-- ${s} --"} def wrappedString = "${ -> wrapme('as var')}" def plainString = "string" pipeline { agent any stages { stage('Demo') { steps { // This works echo wrapme('explicit') // This is skipped echo "Closure: ${ -> wrapme('implicit')}" // so is this echo wrappedString // and this echo "String: ${ -> plainString}" // And this line at least gives an error //echo "As string: ${wrappedString}" } } } }
- Build
The output is[Pipeline] { [Pipeline] stage [Pipeline] { (Demo) [Pipeline] echo -- explicit -- [Pipeline] } [Pipeline] // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline