Skip to content

Commit

Permalink
Merge pull request #82 from wolfs/expose-triggered-projects
Browse files Browse the repository at this point in the history
[FIXED JENKINS-26031] Added export of triggered builds and jobs to XML/JSON API
  • Loading branch information
wolfs committed Mar 5, 2015
2 parents 0e41615 + 486850b commit 1e9372c
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -36,7 +36,10 @@
import java.util.Map;
import java.util.Set;
import jenkins.model.Jenkins;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;

@ExportedBean
public class BuildInfoExporterAction implements EnvironmentContributingAction {

public static final String JOB_NAME_VARIABLE = "LAST_TRIGGERED_JOB_NAME";
Expand Down Expand Up @@ -197,6 +200,7 @@ private List<BuildReference> getBuildRefs(String project) {
*
* @return a list of builds that are triggered by this build. May contains null if a project or a build is deleted.
*/
@Exported(visibility = 1)
public List<AbstractBuild<?, ?>> getTriggeredBuilds() {

List<AbstractBuild<?, ?>> builds = new ArrayList<AbstractBuild<?, ?>>();
Expand All @@ -218,6 +222,7 @@ private List<BuildReference> getBuildRefs(String project) {
*
* @return List of Projects that are triggered by this build. May contains null if a project is deleted.
*/
@Exported(visibility = 1)
public List<AbstractProject<?, ?>> getTriggeredProjects() {
List<AbstractProject<?, ?>> projects = new ArrayList<AbstractProject<?, ?>>();

Expand Down

0 comments on commit 1e9372c

Please sign in to comment.