Search code examples
azure-devopsazure-devops-rest-api

How to set/update test run owner in Azure Devops Rest API?


I am creating a test run in Azure Devops with Rest API. A sample POST request I make is like:

{
    "name": "Test Run Name",
    "automated": true,
    "plan": {
        "id": 11111111,
        "name": null,
        "url": null,
        "state": null,
        "iteration": null
    },
    "pointIds": [
        222222222222
    ],
    "build": {
        "id": "2222233455",
        "buildNumber": "buildNumberjlkajdlajsldj",
        "uri": "vstfs:///Build/Build/2222222222",
        "sourceBranch": "refs/pull/22222/merge",
        "definition": {
            "id": "2222"
        }
    },
    "buildConfiguration": {
        "id": 3333333,
        "number": "buildNumberjlkajdlajsldj",
        "uri": "vstfs:///Build/Build/222222222222"
    },
    "owner": {
        "id": "44444444-2222-bbbb-aaaa-1111111111",
        "descriptor": "aad.AAAAAAAAAAAAAAAAAAAAAAAAAA"
    }
}

But here owner information is ignored and owner is assigned as authorized user of the requester. The requested account have necessary permissions.

Do I make something wrong or owner information cannot be assigned to another user?


Solution

  • As stated here, it is necessary to set "displayName" field in "owner" section of the request.