3

I am trying to create a Visual Studio Team Services Extension Task for my builds and releases. I need a task that will send out an alert to another system if a previous task (including the default build/test/publish/etc.) fails.

I have already created the task to send the alert. However I do not see a way to kick off the task only if my build fails.

Is there a way in VSTS to run a task if a previous task fails, but not run it if all other tasks were successful?

2 Answers 2

3

It is now possible to select a running condition for all tasks with the following possible values:

  • Only when all previous tasks have succeeded
  • Even if a previous task has failed, unless the build was canceled
  • Even if a previous task has failed, even if the build was canceled
  • Only when a previous task has failed
  • Custom conditions

"Only when a previous task has failed" condition selected

EDIT:
It is currently part of a preview, you can enable it through the "Preview features" menu after you click on your profile click on VSTS:
Profile menu

And activate the "New Build Editor":
Preview features menu

Sign up to request clarification or add additional context in comments.

2 Comments

What version of TFS online is this for? I do not see this as an option.
I forgot to said that it is part of a preview, you can enable it through the "Preview features" menu after you click on your profile click on VSTS and activate "New Build Editor".
2

There is no built-in feature.

But you can use the "Rollback" task from the Release Management Utilities to run a powershell script on failure.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.