Since build 2.60, the culprits are no longer available through the json api. They are probably not available through xml api either, the root cause seems to be the same. Steps to reproduce:

      1. Go to a failed build 
        http://localhost:8080/jenkins/job/mytest/3/
      2. Check the json build result
        http://localhost:8080/jenkins/job/mytest/3/api/json
      3. Expect the json output to contain a culprits node but it no longer does 

      In changeset 39136804e53bf9f34cc91fdf3c64ab57d976eac3, method getCulprits was removed from AbstractBuild, as it already existed in the RunWithSCM interface as a default method. However, the model builder in stapler seems to only take @Exported methods from the current declaring class, and not from subclasses, so the data is no longer exported. 

      So, what are the solutions?

      1. Leave things as they are now. I think there are already a few tools on the internet that use this information. We have a dashing.io board that shows the status of various jenkins builds and this is currently broken.
      2. Expose the method back in AbstractBuild, even if just delegates to the RunWithSCM one, like in the attached patch. 
      3. Change the model behaviour in stapler to also consider exported methods from other classes in the hierarchy. I find this the most unlikely, could put out a lot of data. I doubt many use filtering on just what they need, so we would risk flooding them. 

       

       

          [JENKINS-46082] Culprits no longer available through json api

          Aurelian Teglas created issue -
          Oleg Nenashev made changes -
          Labels New: newbie-friendly
          Oleg Nenashev made changes -
          Labels Original: newbie-friendly
          Oleg Nenashev made changes -
          Labels New: stapler
          Oleg Nenashev made changes -
          Assignee New: Andrew Bayer [ abayer ]
          Oleg Nenashev made changes -
          Labels Original: stapler New: regression stapler
          Andrew Bayer made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Andrew Bayer made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Andrew Bayer made changes -
          Remote Link New: This issue links to "core PR #2978 (Web Link)" [ 17440 ]
          Andrew Bayer made changes -
          Remote Link New: This issue links to "workflow-job PR #65 (Web Link)" [ 17441 ]
          Oleg Nenashev made changes -
          Link New: This issue is related to JENKINS-46153 [ JENKINS-46153 ]

            abayer Andrew Bayer
            aurelianteglas Aurelian Teglas
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: