diff --git a/build/postactions.groovy b/build/postactions.groovy index 8a876de..fbc71a4 100644 --- a/build/postactions.groovy +++ b/build/postactions.groovy @@ -44,13 +44,15 @@ def getActionJobName(postbuildactions, String action, String alternativeparamnam } } } - def jobitem = Jenkins.instance.getItemByFullName(jobname) - if (jobitem) { - if (!jobitem.isBuildable()) { + if (!jobname) { + def jobitem = Jenkins.instance.getItemByFullName(jobname) + if (jobitem) { + if (!jobitem.isBuildable()) { + jobname = '' + } + } else { jobname = '' } - } else { - jobname = '' } return jobname } @@ -86,7 +88,7 @@ def performSuccessfulBuildActions() { def postbuildinfo = readJSON(text: POST_BUILD_INFO) def postbuildjsontext = writeJSON(returnText: true, json: postbuildinfo, pretty: 1) echo "Post build info:\n${postbuildjsontext}" - postbuildactions = postbuildinfo['Build outcomes']['Success']['Action'] + postbuildactions = postbuildinfo['Build outcomes']['Success']['Actions'] postbuildinfoavailable = true } def String buildselector = "${BUILD_NUMBER}"