skip to Main Content

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)

enter image description here

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.

enter image description here

2

Answers


  1. Chosen as BEST ANSWER

    Azure has Test Point instance

    A test point is a unique combination of test case, test suite, configuration, and tester

    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": []


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

    enter image description here

    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.

    get https://vstmr.dev.azure.com/<org>/<proj>/_apis/tcm/runs/8/results/100000?detailsToInclude=5&api-version=5.1-preview.1
    

    So I modify the Attachments – Get Test Sub Result Attachment Zip, adding the query filter of detailsToInclude=5 like below.

    https://vstmr.dev.azure.com/<org>/<proj>/_apis/tcm/runs/<runID>/results/<resultID>/attachments/<attachmentID>?detailsToInclude=5&api-version=5.1-preview.1
    

    And I download the attachment correctly.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search