So you can just do something like
public Run getAssociatedBuild(AbstractBuild build){ String name = build.getProject().getName(); String maybeUpstreamName = name.replaceAll("foo","bar"); AbstractProject upstreamProject = AbstractProject.findNearest(maybeUpstreamName); Run mostRecentUpstreamBuild = upstreamProject.getLastBuild(); return mostRecentUpstreamBuild; } I'm able to do the string replace because my job names are by convention. -b On Thursday, January 31, 2013 11:30:47 AM UTC-5, bearrito wrote: > > I'm trying to write a plugin. My question is how I can get build > information about a completely different project than the project that will > notify the listener. > > So as an example > > ProjectA > Build1 > Build2 > ProjectB > Build4 > Build5 > > When ProjectB reaches on completion for say Build6, I will want the > notifier to get information about the most recent build for ProjectA. In > particular I will want to be able to get the environment variable > information along with the person starting the job. > > Looking at http://javadoc.jenkins-ci.org/hudson/model/AbstractBuild.htmlI > feel that one of the getUpstream*() methods is what I want to use. > > Am I on the right track? > > -b > > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.