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

can not catch Abort action of Input Step in Post Failure section in Blue Ocean

    XMLWordPrintable

Details

    Description

      Version:

      • Jenkins ver. 2.46.1
      • Pipeline: Input Step 2.7
      • Pipeline: 2.5
      • Blue Ocean 1.1.2

      Actually this worked before in Blue Ocean, but recently it did not work anymore, I do not know which version introduce this issue. Below is my pipeline code, It is ok when you approve this request, but it does not work when you abort this:

       

      ```

      steps {
        hipchatSend([
          color: "YELLOW",
          message: """hello""",
          notify: true,
          room: "alert",
          textFormat: true
        ])

        timeout(time: 5, unit: "DAYS") {
          input message: "Do you want to approve this?", ok: "OK",    submitter:"bob"
          }
        }

      post {
          success {
          hipchatSend([
            color: "GREEN",
            message: "@all Approve",
            notify: true,
            room: "alert"
          ])
      }

      failure {
          hipchatSend([
            color: "GREEN",
            message: "@all Deny",
            notify: true,
            room: "alert"
          ])
         }
      }

      ```

      Attachments

        Activity

          abayer Andrew Bayer added a comment -

          Not sure what you mean in re: Blue Ocean - is it not visualizing right? Or is the failure block not executing? That wouldn't shock me - try changing from failure to aborted?

          abayer Andrew Bayer added a comment - Not sure what you mean in re: Blue Ocean - is it not visualizing right? Or is the failure block not executing? That wouldn't shock me - try changing from failure to aborted ?
          hanks hanks justin added a comment -

          abayer Thank you for your reply, I reported another issue before, that use the same code, works fine in the standard ui, but not  in Blue Ocean, So I thought this one may related to Blue Ocean too. Yeah, failure block is not executing. From docs here, https://jenkins.io/doc/book/pipeline/syntax/#post-conditions, seems no aborted option, I will try it, thanks.

          hanks hanks justin added a comment - abayer  Thank you for your reply, I reported another issue before, that use the same code, works fine in the standard ui, but not  in Blue Ocean, So I thought this one may related to Blue Ocean too. Yeah, failure block is not executing. From docs here, https://jenkins.io/doc/book/pipeline/syntax/#post-conditions , seems no aborted option, I will try it, thanks.
          hanks hanks justin added a comment -

          abayer I changed to `aborted` and it works!, thanks, I will close this issue.

          hanks hanks justin added a comment - abayer I changed to `aborted` and it works!, thanks, I will close this issue.
          hanks hanks justin added a comment -

          Change failure to aborted and it works. 

          hanks hanks justin added a comment - Change failure to aborted and it works. 

          People

            Unassigned Unassigned
            hanks hanks justin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: