-1

Was wondering if anyone has managed to achieve this. I am currently on VSTS 2017 (Version 15.117.27024.0) where it has been troublesome to find any documentation on what version of REST Api I should be using.

If you require any other information, feel free to let me know.

TheIntern
  • 31
  • 1
  • 2

1 Answers1

0

Get a list of attachment ID's for each Work Item on VSTS

You asked the similar question before but not give any feedback.

To make sure this issue clear. I will answer it again.

To get the attachment id you can use the Get Work Item API with $expand=all:

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

Then you will get the attachment ID in the url in the relations section (I use the tool postman):

enter image description here

So, you can get the attachment ID is acd5af0e-c015-4e8f-8354-a6858582deb2.

BTW, you could download the download the attachment use the API:

https://dev.azure.com/{organization}/{project}/_apis/wit/attachments/acd5af0e-c015-4e8f-8354-a6858582deb2?api-version=5.1-preview.3

Ticket: Attachments - Get

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135