如何从VSTS下载所有附件? [英] How to Download All Attachments from VSTS?

查看:97
本文介绍了如何从VSTS下载所有附件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试根据其ID号将所有工作项附件从VSTS下载到它们自己的文件夹中.如果可能的话,人们将如何继续实现这一目标?

I am attempting to download all Work item attachments from VSTS into their own folder based on their ID number. If this is possible, how would one go on about achieving this?

我研究了rest API,但感到困惑,并且看来所有找到的文档都与Azure DevOps有关.我目前正在使用15.117.27024.0版本.

I've looked into rest API but have been confused, and it appears all documentation I've found is regarding Azure DevOps. I am currently on version 15.117.27024.0.

我已经提供了一些背景信息,如果这不足以诊断我的问题,我将非常乐意提供更多信息.

I've provided some background info, and if that is not sufficient enough in diagnosing my problem, I will be more than happy to provide more.

谢谢大家的帮助.

我已经尝试通过邮递员使用GET命令,使用显示网页的非API" URL,但显示"JavaScript被禁用".在这一点上我很困惑,而且我真的不知道从这里去哪里.

I've tried using the GET command through postman using the "Non API" URL where the web page displays but says "JavaScript is disabled". I am pretty confused at this point and don't really know where to go from here.

推荐答案

1.您可以使用以下

1.You could get all the attachment IDs on a work item using following REST API:

GET https://dev.azure.com/{organization}/{project}/_apis/wit/workitems?ids={id}&$expand=all&api-version=5.0

2.然后,您可以读取url和name属性,其中"rel"属性的值是响应正文中的"AttachedFile",这样您就可以获取附件ID.

2.Then you could read the url and name property which the value of "rel" property is the "AttachedFile" in the body of the response , so that you could get the attachment id.

3.然后您可以使用

3.Then you can use the Attachments- Get rest api to download an attachment.

GET https://dev.azure.com/{organization}/{project}/_apis/wit/attachments/{id}?api-version=5.0

这篇关于如何从VSTS下载所有附件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆