Get stage name in my jenkins plugin

20 views
Skip to first unread message

niss...@taboola.com

unread,
Jan 25, 2018, 8:30:09 AM1/25/18
to Jenkins Developers
I need to get stage name inside my plugin for logging and for sending data to elastic search,
how I can take the stage name?

I working on elastic search plugin for jenkins

Jesse Glick

unread,
Jan 25, 2018, 10:02:21 AM1/25/18
to Jenkins Dev
[StepExecution.this.]getContext().get(EnvVars.class).get("STAGE_NAME")

Jesse Glick

unread,
Jan 25, 2018, 10:03:54 AM1/25/18
to Jenkins Dev
Or you look up `FlowNode.class` and use more precise APIs in the
`org.jenkinsci.plugins.workflow.graphanalysis` package to find
enclosing `stage` blocks as well as much more metadata.
Reply all
Reply to author
Forward
0 new messages