import hudson.model.Result
import jenkins.model.Jenkins

def check_light = build.buildVariables["CHECK_LIGHT"]
if (check_light == "false") {
    print "\n* Not checking the App Catalog light! *\n\n"
} else if (Jenkins.instance.getItem('master-app-catalog-continuous').lastCompletedBuild.result != Result.SUCCESS) {
    print "\n*** CAN'T AUTO-BUMP BECAUSE APP CATALOG IS RED! ***\n\n"
    return 1
}

import hudson.model.Result
import jenkins.model.Jenkins

def jobName = build.buildVariables["DOWNSTREAM_JOB_NAME"]
def job = Jenkins.instance.getItem(jobName)
if (!job) {
    println "\n*** CAN'T FIND JOB ${jobName}! ***\n\n"
    return 1
}

def check_light = build.buildVariables["CHECK_LIGHT"]
if (check_light == "false") {
    print "\n* Not checking the App Catalog light! *\n\n"
} else if (job.lastCompletedBuild?.result != Result.SUCCESS) {
    print "\n*** CAN'T AUTO-BUMP BECAUSE APP CATALOG IS RED! ***\n\n"
    return 1
}

Resolve job via job_name parameter rather than hard-coded value
S69214: Resolve job via job_name parameter rather than hard-coded value
