Using the Jenkins API I am trying to find a way to set the upstream projects for a given job/project.
getUpstreamProjects()
getTransitiveUpstreamProjects()
Is there any way using the API I could set upstream projects?
I do not want to create a build trigger with upstream projects, because I do not want to build transitive upstream projects. I will instead use Groovy to iterate the upstream projects and schedule a build for each of them.
My last resort would be to add upstream projects directly as XML to config.xml
This is what I could find in config.xml
<triggers>
<jenkins.triggers.ReverseBuildTrigger>
<spec></spec>
<upstreamProjects>myLib++</upstreamProjects>
<threshold>
<name>SUCCESS</name>
<ordinal>0</ordinal>
<color>BLUE</color>
<completeBuild>true</completeBuild>
</threshold>
</jenkins.triggers.ReverseBuildTrigger>
</triggers>
This is what I could find in
<upstreamProject>
<name>myLib++</name>
<color>blue</color>
</upstreamProject>
Could not find any configuration in config.xml for upstream projects without a build trigger.