[JENKINS-23365] Work in a general Job

See https://github.com/jenkinsci/jenkins/pull/1257 for background. Will not build right now because we are waiting for 1.568 to be released in a few days, but filing early in the hope of getting comments.
If `build == null` then this clause will not be triggered.