1
votes

I have 2 jobs on Jenkins: job A (the upstream job) and job B (the downstream job) that needs to be triggered after job A has finished.

I used to solve this problem with: configuring Trigger parameterized build on other projects set on job A and it worked perfectly fine.

The thing is, I have been told that I can not do any change to job A so I need to stop using the configuring Trigger parameterized build on other projects from job A (which I added in the past). Is there a way to configure something in job B that will trigger the job once job A is done? I noticed there is an Build after other projects are built but when checking this box, job B never started...

Is there any other way (plugin or something else) that can help me define everything in job B?

Thanks!

1

1 Answers

1
votes

I have not personally tried it, but there is URL Trigger Plugin. According to the wiki page, it allows to monitor URL location for changes, and even inspect the elements of the page for changes.

For your Job A (that you can't change), you can still access it's status with links like:
http://<serverurl>/job/<jobAname>/lastBuild/api/json
or
http://<serverurl>/job/<jobAname>/lastStableBuild/api/json

You can change the json to xml too

Alternatively, if you don't want to get involved in parsing all that output, you use simply:
http://<serverurl>/job/<jobAname>/lastBuild/buildNumber
When the Job A finishes a new build, the content of the above address will change, and the URL Trigger Plugin on Job B would trigger it.