-
Bug
-
Resolution: Duplicate
-
Major
-
None
This is a regression observed between Jenkins LTS 2.89.4 and LTS 2.107.2.
The version of the Job DSL plugin (1.69) is unchanged.
To reproduce:
1. Run the following Job DSL to create a folder and some sample views within that folder.
folder('/dir') { displayName('dir') } buildMonitorView('/dir/Test BMV') { jobs { regex('.*') } } listView('/dir/Test LV') { jobs { regex(".*") } }
2. Run the following Job DSL script on its own.
folder('/dir') { displayName('dir') }
Before the upgrade to Jenkins 2.107.2, this worked fine. Following the upgrade, step 2 destroys the views that were created in step 1.
- duplicates
-
JENKINS-31308 Creating folder removes existing views within that
-
- Open
-
Apologies, I meant to raise this as a bug originally. I have now fixed that field.
Note that we have found it is possible to work around this issue by testing if the directory already exists or not, and only creating if it doesn't, e.g.
import jenkins.model.Jenkins
if (!Jenkins.instance.getItem('dir')) ...
but this is clearly unsatisfactory in the longer term.