2.22 (2018 02) API . JENKINS-41272.
currentBuild currentBuild :
getBuildCauses
- getBuildCauses(String causeClass)
- ,
Cause JSON- , , JSON-, .
, :
echo "${currentBuild.buildCauses}" // same as currentBuild.getBuildCauses()
echo "${currentBuild.getBuildCauses('hudson.model.Cause$UserCause')}"
echo "${currentBuild.getBuildCauses('hudson.triggers.TimerTrigger$TimerTriggerCause')}"
:
[Pipeline] echo
[[_class:hudson.model.Cause$UserIdCause, shortDescription:Started by user anonymous, userId:null, userName:anonymous], [_class:org.jenkinsci.plugins.workflow.cps.replay.ReplayCause, shortDescription:Replayed #12]]
[Pipeline] echo
[]
[Pipeline] echo
[]
[Pipeline] End of Pipeline
Finished: SUCCESS
, currentBuild.getBuildCauses(type) type Cause . , currentBuild.getBuildCauses('org.jenkinsci.plugins.workflow.cps.replay.ReplayCause') java.lang.ClassNotFoundException. JENKINS-54673 2.22 Pipeline: Supports APIs (workflow-support). , 2.24.