创建启用自动完成功能的拉取请求 Azure DevOps rest API

Creating a pull request with autocomplete enabled Azure DevOps rest API

我正在努力弄清楚如何使用 API 创建启用自动完成的拉取请求,如果有人可以提供已发布的 JSON 示例以启用自动完成太棒了。

我已经尝试设置 autoCompleteSetBy 属性 并且还在 completionOptions 属性 中尝试了一大堆设置。

使用 Create PR rest API. you can only update a current PR with autocomplete enabled with the Pull Requests - Update 时无法创建启用自动完成的 Pull Request,因此您需要创建 PR,获取新 ID,然后更新它。

基本体就是用实际运行API的用户ID指定autoCompleteSetBy:

"autoCompleteSetBy":  {
                          "id":  "dsafasf-41531tf-safsaf-24124fas-sfasfasf"
                      }

您还可以使用 completionOptions 添加其他参数,例如 squash merge 等,请参阅 here

如果您想自动创建 Pull Requests 过程,您可以安装 Create Pull Request 扩展。