How to Download All Attachments from VSTS?

梦想的初衷 提交于 2019-12-11 19:09:44

问题


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?

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.

Thank you all for your help.

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.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.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



来源:https://stackoverflow.com/questions/56656447/how-to-download-all-attachments-from-vsts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!