Update Azure Pipeline Task Completion Status via REST API

89 Views Asked by At

Below is my YAML release pipeline code:

- stage: Stage1
  jobs:
  - job: Job1
    displayName: Test
    pool: server
    steps:
    - task: Delay@1
      displayName: I am waiting for you..
      inputs:
        delayForMinutes: 300
      TimeOutInMinutes: 299

I have included a Delay task set to wait for 5 hours and fail if its status isn't updated through our tooling.

I need to use Azure DevOps REST APIs to update the status of the above Delay task (to completed or passed) when the pipeline runs, ensuring it succeeds before reaching a timeout of 299 minutes.

So, How can I make the above task as completed/succeeded ?

1

There are 1 best solutions below

0
Ziyang Liu-MSFT On BEST ANSWER

There isn't such a REST API can update the state of a task. For YAML pipeline, you can only update the state of one build using REST API Builds - Update Build.

enter image description here