-
Bug
-
Resolution: Fixed
-
Major
-
Jenkins 2.89.3
active-choices 2.1
Window 7 64-bit
In a possible regression of [JENKINS-34988|https:/issues.jenkins-ci.org/browse/JENKINS-34988], the this.binding.jenkinsProject appears to contain context from the most recently saved project.
This was found in a 'folders' based project after replicating a freestyle job from one folder to another. The job in the later folder was then referenced in builds of the first. It was not discovered how to get the first job to revert to its correct context, resaving it did not appear to change things.
To reproduce,
create folder-a/job-a.
Add Active Choices Parameter p1 with script:
import jenkins.*
import jenkins.model.*
import hudson.model.*def list = []
def parent = this.binding.jenkinsProject.getParent()
list.push( parent.name.toString())
def children = parent.getItems()
children.each{ child -> list.push(child.name.toString()) }}}{{return list
Save and run, should see folder-a and job-a listed as options for p1.
Create folder-b/job-b, as above.
Run job-a and will see folder-b and job-b listed as options for p1.