I cannot figure out what changelist was used for an arbitrary build.
We used the SVN plugin in the past, and for any arbitrary build, we can examine the "api/xml" url and it will tell us what revision was used to build that particular build.
With the perforce plugin, if you examine the api/xml, the "changeSet" is null. The workaround is to parse the output of the job for the value of the changeSet that was used. This is not ideal, since if the text changes, then the parsing will not work.
Steps to Reproduce:
1. Submit a change to perforce.
2. Run your build. You'll notice that the "changeSet" value in the "http://localhost:8080/jenkins/job/foo/1/api/xml" correctly has your changelist number.
3. Run your build again without making a perforce submission. Examine "http://localhost:8080/jenkins/job/foo/2/api/xml". You don't know what changeSet number was used to build this job. The "changeSet" value is null. ("<changeSet/>")
On a side note, if you examine the build.xml that is saved in the Jenkins job directory for that particular build, you'll see your changeSet number. It just has to be displayed via the api/xml.
Thanks! If you need any specific info, or if you have a workaround, let me know!
Oh, we're using perforce plugin version 1.3.17