-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
When running a build from another job and setting the propagate property to true, if the downstream job fails, the returned value is null.
For example, if I want to copy the artifacts and I use returnValue.getNumber(), I get the error message:
java.lang.NullPointerException: Cannot invoke method getNumber() on null object
- relates to
-
JENKINS-53923 Collecting build job results using [.result] property returns null
-
- Open
-
[JENKINS-48475] Build step returns null if propagate set to true
Resolution | New: Not A Defect [ 7 ] | |
Status | Original: Open [ 1 ] | New: Resolved [ 5 ] |
Resolution | Original: Not A Defect [ 7 ] | |
Status | Original: Resolved [ 5 ] | New: Reopened [ 4 ] |
This is correct/expected behavior - check the help text for propagate at https://jenkins.io/doc/pipeline/steps/pipeline-build-step/#build-build-a-job. If propagate is true and the downstream build fails/is aborted/is unstable, the build step fails and returns null. If you want to act on the result of the downstream build, you want propagate set to false.