Using RQM REST API to obtain attachment name of a test case?
I can get attachment links of a test case with the following:
GET /qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/PRJAREA/testcase/ID
and, I can get attachment name of all attachments with the following:
GET /qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/PRJAREA/attachment
However:
- the attachment link may NOT be identical in the above 2 GET requests, since ID might be generated, internal or external
- GET the attachment link downloads the attachment instead of providing me attachment information
My question is: How do I get the file name of attachments of a test case?
Accepted answer
Unfortunately, you have to make two RQM Reportable REST API requests:
1. GET test case to resolve the attachment URL(s).
2. GET attachment feed (or resource) to resolve the attachment name.
1. GET test case to resolve the attachment URL(s).
2. GET attachment feed (or resource) to resolve the attachment name.
Comments
The problem is that the attachment URLs obtained from GET testcase actually download the attachments instead of showing attachment information.
Use the Accept=application/xml header on your GET request. See https://jazz.net/wiki/bin/view/Main/RqmApi#ResourcesFootnote6.
That's exactly what I needed, thanks!