简体   繁体   English

Azure Devops API:构建 - 在构建之间获取工作项 - 未经授权

[英]Azure Devops API: Builds - Get Work Items Between Builds - Unauthorized

I have used the azure devops rest API to create an app which consolidates work item changes for our team, for individual build ID's based on a few pipelines, which works wonders.我已经使用 azure devops rest API 创建了一个应用程序,该应用程序为我们的团队整合了工作项更改,该应用程序基于一些奇迹管道来工作。

I have configured my PAT to have access to work items and builds, and successfully used the " Builds - Get Build Changes " endpoint in my current setup.我已将 PAT 配置为可以访问工作项和构建,并在当前设置中成功使用了“ 构建 - 获取构建更改”端点。

I wish to now get and consolidate changes between builds by using the " Builds - Get Work Items Between Builds " rest API endpoint.我现在希望通过使用“ Builds - Get Work Items Between Builds ” rest API 端点来获取和合并构建之间的更改。 But I seemingly cannot, because it simply returns a "401 - Unauthorized" response.但我似乎不能,因为它只是返回一个“401 - 未经授权”的响应。

I have tried it in Postman too.我也在 Postman 中尝试过。 I am unsure why the same Auth configuration returns the expected result for " Builds - Get Build Changes " but returns unauthorized for " Builds - Get Work Items Between Builds "我不确定为什么相同的 Auth 配置会为“ Builds - Get Build Changes ”返回预期结果,但为“ Builds - Get Work Items Between Builds ”返回未经授权的结果

Out of interest sake, I tried the " Builds - Get Changes Between Builds " end point which returned a successful response.出于兴趣,我尝试了“ Builds - Get Changes Between Builds ”端点,它返回了成功的响应。

So, in short: For the same Postman auth configuration:因此,简而言之:对于相同的 Postman 身份验证配置:

PAT scope:帕特 scope:

  • Build: Read构建:阅读
  • Release: Read发布:阅读
  • Work Items: Read工作项目:阅读

EDIT:编辑:

Just did an exercise - Full access Token worked.刚刚做了一个练习 - 完全访问令牌有效。

I filtered it down to requiring the following PAT scope我将其过滤为需要以下 PAT scope

  • Build: Read构建:阅读
  • Release: Read发布:阅读
  • Work Items: Read工作项目:阅读
  • Token Administration: Read & manage令牌管理:阅读和管理

Why do we require Token Administration: Read & manage?为什么我们需要令牌管理:阅读和管理?

Help or insight would be appreciated.帮助或洞察力将不胜感激。

Thank you.谢谢你。

I have helped you to submit the feedback ticket and then ticket has report to Azure DevOps Service Product team.我已经帮助您提交了反馈票,然后票已报告给 Azure DevOps 服务产品团队。 To receive the notification about it in time, you can follow this feedback ticket.要及时收到有关它的通知,您可以关注此反馈票。

In addition, if have any achievements, I will inform you here.另外,如果有任何成就,我会在这里通知您。

Update1更新1

In the doc , we can see that the the description of Token Administration is Grants the ability to manage (view and revoke) existing tokens to organization administrators.文档中,我们可以看到 Token Administration 的描述是 Grants the ability to manage (view and revoke) existing tokens to organization administrators。 The API Just get the work items between builds, it should not need the permission. API 只是在构建之间获取工作项,它应该不需要权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM