Testcases and fix for Jenkins-14278

This fixes the issue seen in Jenkins-14278, by getting the project from the rootbuild rather than the current build. this means that the project is searched for in the correct item group when using Matrix builds. 

 https://issues.jenkins-ci.org/browse/JENKINS-14278