Hi,

I am trying to get a variable value from last successful build, but getting 
error "*groovy.lang.MissingMethodException: No signature of method: 
org.jenkinsci.plugins.workflow.support.steps.build.RunWrapper.previousBuild() 
is applicable for argument types: () values: []*".

void lastSuccessSVNRevision() {
    def lastSuccessSVNRev = 0
    def build = currentBuild.previousBuild()
    while (build != null) {
        if (build.result == "SUCCESS")
        {
            lastSuccessSVNRev = build.getRawBuild().actions.find{ it 
instanceof ParametersAction }?.parameters.find{it.name == 'SVN_REVISION'}?.
value
            break
        }
        build = build.previousBuild()
    }
}

Could you someone help me to get the variable value from last success build.

Thanks,
Rajesh M

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/ae6d7cec-7b35-406f-9f26-dcad534a1eba%40googlegroups.com.

Reply via email to