Azure Devops Rest API-使用PAT时创建请求请求所有者问题

问题描述

我正在尝试通过rest api使用createdby选项创建拉取请求,例如JSON下面的

{
  "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"
            }
        ]
    }

但是API方法无法在createdBy区域上处理我的用户ID。 看来,Api正在此区域使用个人访问令牌所有者。 因为我使用api创建的所有请求请求都具有相同的令牌所有者。 请注意,api可以真正在审阅者区域上获取此用户ID。

有人知道这种行为的细节吗?

有关创建拉取请求的API参考;

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

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)