Search code examples
javajunitazure-devopsautomation

Update test case outcome status in azure test plans


I want to update test case outcome status in azure test plans. How can I do this? I found only how to get info about test plans but without update per test case.


Solution

  • I want to update test case outcome status in azure test plans. How can I do this?

    When you manually update the test case outcome status in azure test plans, you could go to the test run and select more options:

    enter image description here

    And if you want update the test case outcome states with REST API, you could try to use following REST API Results - Update:

    PATCH https://dev.azure.com/{organization}/{project}/_apis/test/Runs/{runId}/results?api-version=6.0
    

    Request Body:

    [
      {
        "id": 100000,
        "state": "Completed",
        "comment": "Website theme is looking good",
        "associatedBugs": [
          {
            "id": 30
          }
        ]
      },
      {
        "id": 100001,
        "state": "Completed",
        "comment": "Website links are failing because of incorrect container id",
        "failureType": "Known Issue"
      }
    ]