Reputation: 301
Using Jenkins groovy API how to know the status of a build whether it's success or failure .
I have a job in https://localhost.com/Jenkins/Mano/Dev/parallel/123
Where parallel is the job name and 123 is its build number . And the job is residing inside Mano/Dev folder .
I'd like to know the status of the Job with build number 123 .
Is there any direct API call to find the status
Any help is highly appreciated .
Thanks
Upvotes: 1
Views: 1610
Reputation: 3075
Jenkins got a REST api, if you open your jobs page, select your build, visit the REST api link in the bottom right. Its quite self explanatory, i.e. to get the result in json: http://<junkins url>/job/<job name>/<build #>/api/json?tree=result
Upvotes: 2