Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Accessing Test Case File Attachments Through API


#1

Hi,

Right now, it looks like uploaded files are not linked to cases. For instance:
Test case:
https://XY.testrail.com/index.php?/cases/view/2
Uploaded files to that case:
https://XY.testrail.com/index.php?/attachments/get/4/test.txt
https://XY.testrail.com/index.php?/attachments/get/5/xy.doc

As part of our automated testscript pipeline we’d like to access/list file attachments of test cases. Is it possible to get a list of attachments linked to a specific test-case via your API ?

Thanks!
Dennis


#2

Hello Dennis,

Thanks for your posting and your feedback. Attachments are linked to test cases (or test results) but this is not visible in the web address (it just contains the ID of the attachment). The API currently doesn’t have support for attachments unfortunately but this is one of the next things we would like to look into regarding the API.

Regards,
Tobias


#3

Hi Tobias,

Thanks for your answer and apologize my late reply on it.

It would be great if you could support that, it would help us a lot. We’re right now planning a new automation pipeline, is this a feature you’re planning to release soon or should we better plan a workaround ?

Thanks!

Cheers,
Dennis


#4

Hello Dennis,

Thanks for the update. Attachment support is planned but we don’t currently have an estimate for this unfortunately so I would recommend using a workaround if possible. For example, you can upload screenshots or other files elsewhere and then just include/link them in TestRail in the text fields:

http://docs.gurock.com/testrail-userguide/userguide-editor

Regards,
Tobias


#5

Hi guys!
Almost 3 years there are posts on forum about accessing file attachments through API but still we can’t get this feature. Have you already set any estimate to create this function in API?
Thanks.
PS: this feature really needed for automated testing :smile:


#6

Hi Alex,

Thanks for your posting! We currently don’t have an estimate but you can already store attachments in an external location and then include a simple link in the result description.

Regards,
Tobias