We pulled the change above and rebuilt the plugin but still got 'unable to find job to copy artifact from' errors. We are trying to copy junit test result files from child phases up to the parent job so as to collate build results in one place.
In case someone else is currently blocked by this there is a workaround using the EnvInject plugin. After your build phases have run execute a python build step with the following code. It uses the Jenkins JSON API to create a new file called propsfile containing the build numbers and success/failures of all the child phases that have executed so far as JOB_NAME_BUILD_NUMBER and JOB_NAME_BUILD_SUCCESS (note it replaces hyphens with underscores to avoid invalid environment variables).
#!/usr/bin/env python
import os
import json
import urllib2
url = os.environ['BUILD_URL']
req = urllib2.Request('%s/api/json' % url, headers = {'Accept' : 'application/json'})
res = urllib2.urlopen(req)
res = json.loads(res.read())
f = open('propsfile', 'w')
try:
buildNumbers = {}
for subbuild in res['subBuilds']:
name = subbuild['jobName'].upper()
name = name.replace('-', '_')
f.write('%s_BUILD_NUMBER=%s\n' % (name, subbuild['buildNumber']))
f.write('%s_BUILD_SUCCESS=%d\n' % (name, subbuild['result'].lower() == 'success'))
finally:
f.close()
Then add a subsequent envinject step to pull the contents of that propsfile in and you can use the resulting environment variables to copy artifacts from the correct triggered child builds. You can also use the build success environment variables and the ConditionalJob plugin to optionally run steps (in the case where you have an early smoke test phase that prevents the lengthy subsequent phases from executing if it fails).
You may copy the files on the good workspace or in a shared. If the jobs run on the same server, you can use ${WORKSPACE} for determine the workspace of the MultiJob Build in sub build phase.