Azure Devops Rest API - Create Pull Request Owner Issue When Using PAT

Viewed 415

I am trying to create pull request with createdby option like below JSON via rest api;

{
  "createdBy": {"id": "b568ab19-05a8-6199-9bee-95f3b7b994c9"},
  "sourceRefName": "refs/heads/hotfixes/hotfix-test-2",
  "targetRefName": "refs/heads/master",
  "title": "Merge SourceBranch to master",
  "description": "This PR Created automatically via REST API, plese do not forget to complete this PR!! ",
        "reviewers": [
            {
                "id": "a048902e-aa3b-62ac-9407-baff1ba594fb",
                "isRequired": "true"
            }
        ]
    }

But API method cant handle my user id on the createdBy area. Api is using personal access token owner for this area it seems. Because all pull requests that i created with api has same token owner. Note that api can get this user id on reviewer area truely.

Are there anybody know detail of this behaviour?

Here the API reference about create pull request;

POST https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pullrequests?api-version=5.0

https://docs.microsoft.com/en-us/rest/api/azure/devops/git/pull%20requests/create?view=azure-devops-rest-5.0

0 Answers
Related