// promotion for project1.
hudson.plugins.promoted_builds.JobPropertyImpl promote = new hudson.plugins.promoted_builds.JobPropertyImpl(project1);
project1.addProperty(promote);
// promotion process to trigger project3
PromotionProcess pp = promote.addProcess("TRIGGER");
pp.conditions.add(new DownstreamPassCondition(project2.getName()));
pp.getBuildSteps().add(new TriggerBuilder(createTriggerConfig(project3.getName())));
// When using built-in BuildTrigger, set up as following:
//pp.getBuildSteps().add(new hudson.tasks.BuildTrigger(project3.getName(), "SUCCESS"));
// Are there any other ways to enable a new BuildTrigger?
Jenkins.getInstance().rebuildDependencyGraph();