I can get and upload attachments to the test result (green on screen)
But how can I get result attachments that uploaded manually by Web runner (red on screen)
Use this API doc
https://learn.microsoft.com/en-us/rest/api/azure/devops/test/attachments?view=azure-devops-rest-5.1
The point is I see the attachment id by mouse hover, so the ID aasighned to the attachments, but can not get it via API.
2
Answers
Azure has Test Point instance
Test Point - Get Points
From the Test Point I got "lastTestRunId" and the relevant Test Result: Results - List . Test Result has the attachments by his own, but also manual testing test result iterations there, that in turn has attachments as well. So, to get attachment id I should got the Iteration first: Iterations - Get -> "attachments": []
Hi I opened the F12 mode to capture the request calls in the current page, and I searched my attachment name in the network traces and found the rest api to list my target attachment.
And the api below looks similar to that in the doc you shared about Attachments – Get Test Sub Result Attachments, and with this api, you could get the attachment ID.
So I modify the Attachments – Get Test Sub Result Attachment Zip, adding the query filter of
detailsToInclude=5
like below.And I download the attachment correctly.