Reputation: 887
Is it possible to target the previous build in a custom condition?
What I try to accomplish:
Upvotes: 0
Views: 128
Reputation: 31075
No, it's not able to target the previous build in a custom condition. Custom condition can only target in the same build. You can add a task to use REST API checking the previous build result and current build result, and determine whether to post a message to Slack.
Upvotes: 1
Reputation: 1
One way would be to retrieve the latest build and read the build status using the Rest API. The Slack message would then be conditional on previous BuildResult == succeeded & current BuildResult == failed.
You can get information about the previous build using the azure-devops rest API here:
Azure DevOps Services Rest API GET Builds List
Upvotes: 0