Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-44456

Provide a way to access a stage name from within the stage and its contents

    Details

    • Similar Issues:

      Description

      Please provide a way to access the stage name from within the stage and its contents (like post).

      Background

      I have a multibranch declarative script. I am struggling with the limitation of one JenkinsFile per branch. I want to run various tasks (i.e. stages) on the branch (e.g. build several separate apps) and have a clear indication of which stage failed in the email notification subject sent on failure. I assume that stage processing will stop as soon as one stage fails. The post clause can then call the email-ext plugin and specify in Subject the stage that failed. Developers will then see quickly which task failed, rather than having to look through the console log (or email body).

        Attachments

          Issue Links

            Activity

            Hide
            jessie_hs Jessie Ye added a comment -

            Is STAGE_NAME supported for parallel branches in scripted pipeline?

             

            Show
            jessie_hs Jessie Ye added a comment - Is STAGE_NAME supported for parallel branches in scripted pipeline?  
            Hide
            rrotaru Robert Rotaru added a comment - - edited

            The wiki still shows 2.2 as the latest release version, despite the README below also showing 2.3 as available (and archives also showing 2.3 as available).

            https://wiki.jenkins.io/display/JENKINS/Pipeline+Stage+Step+Plugin

            Is there a reason for this?

            Show
            rrotaru Robert Rotaru added a comment - - edited The wiki still shows 2.2 as the latest release version, despite the README below also showing 2.3 as available (and archives also showing 2.3 as available). https://wiki.jenkins.io/display/JENKINS/Pipeline+Stage+Step+Plugin Is there a reason for this?
            Hide
            pyrocks Mor L added a comment - - edited

            This is SO very useful (I was about to implement a wrapper to the stage step which does exactly that) - thanks.

            Show
            pyrocks Mor L added a comment - - edited This is SO very useful (I was about to implement a wrapper to the stage step which does exactly that) - thanks.
            Hide
            zmeggyesi Zalan Meggyesi added a comment -

            Andrew Bayer Many thanks, Andrew!

            Show
            zmeggyesi Zalan Meggyesi added a comment - Andrew Bayer Many thanks, Andrew!
            Hide
            davida2009 David Aldrich added a comment -

            Andrew Bayer Thanks for releasing this change.  Where can I find out what the related env variable is, and perhaps an example of how to use it?

            Show
            davida2009 David Aldrich added a comment - Andrew Bayer Thanks for releasing this change.  Where can I find out what the related env variable is, and perhaps an example of how to use it?

              People

              • Assignee:
                abayer Andrew Bayer
                Reporter:
                davida2009 David Aldrich
              • Votes:
                0 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: