Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

how to trigger a notification step when the previous step failed?

Xinyu Wang August 20, 2024

I don't mean the after-script, the challenge is the step that hosts the after-script don't even get executed.

Consider this pseudo pipeline yaml:

definitions:

    - step: &step1-will-pass

        script:

            - step1 script here

    - step: &step2-will-fail

        script:

            - step2 script here

    - step: &notify-build-status

        after-script:

            - notification script here

pipelines:

    custom:

        'release':

            - step: *step1-will-pass

            - step: *step2-will-fail

            - step: *notify-build-status

In the custom pipeline 'release', when step2-will-fail gets executed and failed, the pipeline stops right there, The notify-build-status step will not be executed.

 

 

1 answer

0 votes
Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2024

Hi @Xinyu Wang ,

Can't you move the notification to step-2?

There is a discussion for a similar problem and two related feature requests here and here.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events