Get List of Files Attached to Defect

Applies to QAComplete 12.80 SaaS, last modified on April 20, 2021

To get a list of files attached to a defect, call the …/projects/{ProjectId}/Bugs/{EntityId}/files (GET) method. The EntityId parameter specifies the ID of the defect whose attachments you want to get.

To get a list of files attached to an item of another type (to a test or requirement), replace the Bugs entity code in the operation call with the needed entity code (Tests or Requirements respectively).

Request

curl -u john.smith@edgb.com:p@ssword -X GET -H "Content-Type: application/json" -H "Accept: application/json" http://yourserver.com/rest-api/service/api/v1/projects/11873/Bugs/12/files

Response

The server will return a list of all the files attached to the specified defect:

{
  "metadata": {
    "result_set": {
      "count": 2,
      "offset": 0,
      "limit": 25,
      "total": 2
    },
    "permissions": {
      "acl": 7
    }
  },
  "results": [
    {
      "attachment_type_code": "File",
      "file_name": "attachment1.txt",
      "title": "Attachment 1",
      "date_created": "2015-06-29T11:23:52.3970000",
      "date_updated": "2015-06-29T11:23:52.3970000",
      "entity_code": "Bugs",
      "entity_id": 12,
      "update_user_id": 24663,
      "user_name": "Smith, John"
    },
    {
      "attachment_type_code": "File",
      "file_name": "http://testserver.com/media/images/pic01.png",
      "title": "image",
      "comment": "Comment 1",
      "date_created": "2015-06-29T11:41:55.6370000",
      "date_updated": "2015-06-29T11:41:55.6370000",
      "entity_code": "Bugs",
      "entity_id": 12,
      "update_user_id": 24663,
      "user_name": "Smith, John"
    }
  ]
}

See Also

QAComplete REST API
/projects/{ProjectId}/{EntityCode}/{EntityId}/files (GET)

Highlight search results