On Fri, Mar 11, 2016 at 9:34 AM, Robert Sandell <[email protected]> wrote:
> Stapler.getCurrentRequest().findAncestor(View.class).getObject()

Or more simply, `@AncestorInPath View view` from a web method.

However if you are doing this from a `FormValidation doCheckXXX` web
method called from a lazy-loaded block (such as a newly configured
property), you are probably hitting JENKINS-19413. Workaround:

https://github.com/jenkinsci/workflow-plugin/blob/82e7defa37c05c5f004f1ba01c93df61ea7868a5/step-api/src/main/java/org/jenkinsci/plugins/workflow/util/StaplerReferer.java#L61

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" 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-dev/CANfRfr06b0sewkic1A4UW%3DZxbXwesCggwLNH7x1_LKaGTTK0cw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to