-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major
-
Component/s: blueocean-pipeline-editor-plugin
When using blueocean-pipeline editor with when conditions in JenkinsFile we get errors about "Empty closure" and "Expected When Condition", below is JenkinsFile.Â
If I load the above file and then click on edit in blue ocean I get the following errors
- Expected a when condition @ line 10, column 7.
- Expected a when condition @ line 18, column 7.
- Empty when closure, remove the property or add some content. @ line 10, column 7.
- Empty when closure, remove the property or add some content. @ line 18, column 7.

pipeline {
agent any
stages {
stage('Make Coffee') {
steps {
echo 'Making Coffee'
}
}
stage('Test Coffee') {
when {
changeRequest()
}
steps {
echo 'Test'
}
}
stage('Serve Coffee') {
when {
buildingTag()
}
steps {
echo 'Drink the Coffee'
}
}
}
options {
checkoutToSubdirectory('configuration')
timestamps()
}
}
Â
I generated the When statements using the Declarative pipeline generator from with in Jenkins.
Â
I also tested with the examples from the main jenkins site https://jenkins.io/doc/book/pipeline/syntax/Â and when I add these to my jenkinsfile , the blueocean editor complains the same as above.
Â
I am unsure if I am doing something incorrectly of of it a true bug so hopefully someone can look at this and provide some insights.
Â
Also using the online documentation