-
New Feature
-
Resolution: Unresolved
-
Major
-
None
As in JENKINS-15843, I am using the URL Trigger to monitor the last successful build number of a job on another Jenkins server, but I also need to know the number of the newest successful build. I currently use the URL Trigger to watch either the full content of the buildNumber page (http://JENKINS/job/JOB/lastSuccessfulBuild/buildNumber) though it could just as easily be JSON path "number" on http://JENKINS/job/JOB/lastSuccessfulBuild/api/json
After this job is triggered, I have a script to scrape the number into an environment variable:
TRIGGER_BUILD_NUMBER=$(curl http://JENKINS/job/JOB/lastSuccessfulBuild/buildNumber)
On Linux this is easy, but on Windows it is significantly more difficult. Also, to use it outside of the shell (i.e. send to downstream builds, in an email, etc.), I then have to write this value out to a file and load with EnvInject. It would be really nice if I could have the option to save the retrieved value from URL trigger as an environment variable that I could use in the rest of the build process