Post when stage is skipped due to when conditional

This issue is archived. You can view it, but you can't modify it. Learn more

      The following pipeline does not trigger the post section:

      pipeline {
          agent any
      
          stages {
              stage('Test') {
                  when {
                      expression { return false; }
                  }
                  steps {
                      echo 'working'
                  }
                  post {
                      always {
                          echo 'post'
                      }
                  }
              }
          }
      }
      

      I expected this to actually echo 'post' and for post to also have a 'skipped' option. Would love to see those.

            Assignee:
            Unassigned
            Reporter:
            Omer van Kloeten
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: