I'm using Azure DevOps Services REST API 5.1 to create test runs in my DevOps Test Plan.
I first create a test run like the documents here
Postman request:
POST /{Organization}/{project}/_apis/test/runs?api-version=5.0 HTTP/1.1 Host: dev.azure.com
Authorization: Basic xyz
Content-Type: application/json
{
"name": "koko",
"automated": true
}
I then add a test result to the previously created test Run. doc.
Postman Request:
POST /{organization}/{project}/_apis/test/Runs/240/results?api-version=5.0 HTTP/1.1
Host: dev.azure.com
Authorization: Basic xyz
Content-Type: application/json
[
{
"Project": {
"Id": "xxxxxxxx-xxxx-xxxx-xxxx-c748b3ba25f6",
"Name": "Project",
"Url": "https://dev.azure.com/xx/_apis/projects/xxxxxxxx-xxxx-xxxx-xxxx-c748b3ba25f6"
},
"StartedDate": "2020-07-07T16:25:56.4171217+03:00",
"DurationInMs": 550,
"Outcome": "Passed",
"State": "Completed",
"TestCase": {
"Id": "6304",
"Name": "TestCase",
"Url": "https://dev.azure.com/{organization}/{project}/_apis/testplan/Plans/6302/Suites/6303/TestCase/6304"
},
"TestRun": {
"Id": "240",
"Name": "koko",
"Url": "https://dev.azure.com/{organization}/{project}/_apis/test/Runs/240"
},
"Priority": 2,
"CreatedDate": "2020-07-07T16:24:56.4171092+03:00",
"TestCaseTitle": "TEST8",
"TestPlan": {
"Id": "6302",
"Name": "Template",
"Url": "https://dev.azure.com/{organization}/{project}/_apis/testplan/Plans/6302"
},
"TestSuite": {
"Id": "6303",
"Name": "Template",
"Url": "https://dev.azure.com/{organization}/{project}/testplan/Plans/6302/Suites/6303"
},
"AutomatedTestName": "TEST8"
}
]
The problem I'm facing is that the created test result does not show the referenced Test Plan, Test Case Id, and Test Suite.
Current Result:
Expected Result:

