Search code examples
jenkinsjenkins-api

Know which build step is failed through api


I am trying to find out the details of a build through API. I am using below to get the specific result. http://localhost:8080/job/test/lastBuild/api/json?pretty=true

Now when the build is failed, I am just getting the status of the build. I want to determine which build step is causing the problem. Please let me know how can I get it through api


Solution

  • This is a interesting question.

    I never found something like this before, since Jenkins just tell you good or bad as you said.

    A possible solution would be using the Jenkins BFA plugin.

    https://wiki.jenkins-ci.org/display/JENKINS/Build+Failure+Analyzer

    This plugin can help you auto detect the error based on the error pattern you described in the config.

    And then you can collect the detail error info from the jenkins json file.

    Br,

    Tim