how to get $CAUSE in workflow

2019-01-19 10:40发布

Jenkins has a $CAUSE variable available to freestyle build jobs.

How can I access this or something similar in workflow?

My team makes use of it in email output of existing ad-hoc builds. We'd like to continue the same in new workflow based jobs.

7条回答
混吃等死
2楼-- · 2019-01-19 11:16

As of early 2018, it looks like that information is now available with JENKINS-31576 being closed:

def manualTrigger = true
currentBuild.upstreamBuilds?.each { b ->
  echo "Upstream build: ${b.getFullDisplayName()}"
  manualTrigger = false
}
查看更多
登录 后发表回答