|
When a downstream project is triggered it gets the same build cause as its upstream project.
If upstream project ProjectA is triggered manually by a user, then the downstream project ProjectB gets the same build cause.
In effect there is no way to find out if ProjectB was triggered from an upstream project.
From hudson.model.AbstractBuild:
build.getCauses() will always yield hudson.model.Cause.UpstreamCause
It works for a Free-style project, but its wrong cause in a Multi-Configuration Job.
Free-style Jobs:
ProjectA
cause.toString() == hudson.model.Cause$UserIdCause@caebc9aa
cause.getClass() == class hudson.model.Cause$UserIdCause
ProjectB
cause.toString() == job/projectA/1[hudson.model.Cause$UserIdCause@2efba933]
cause.getClass() == class hudson.model.Cause$UpstreamCause
Multi-configuration Jobs:
ProjectA
cause.toString() == hudson.model.Cause$UserIdCause@caebc9aa
cause.getClass() == class hudson.model.Cause$UserIdCause
ProjectB
cause.toString() == job/projectA/1[hudson.model.Cause$UserIdCause@2efba933]
cause.getClass() == class hudson.model.Cause$UserIdCause
|