Upload Attachment to a test artifact with RQM Url Utility (REST API)
I'm using RQM Url Utility for uploading an attachment to RQM 5.0. I've successfully uploaded it using the followinfg command:
java -jar RQMUrlUtility.jar -command POST -user xx -password xx -filepath C:\xx.jpg -url https://xxx:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<project_alias>/attachment
Since the attachment is not associated with test case or test script ID, there is no way I can see this attachment using the UI. So I tried to associate with a test script or test case but not successfull result was obtained.
I tried this commands:
java -jar RQMUrlUtility.jar -command POST -user xx -password xx -filepath C:\xx.jpg -url https://xxx:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<project_alias>/attachment/urn:com.ibm.rqm:testcase:51
java -jar RQMUrlUtility.jar -command PUT -user xx -password xx -filepath C:\xx.jpg -url https://xxx:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<project_alias>/attachment/urn:com.ibm.rqm:testcase:51
java -jar RQMUrlUtility.jar -command POST -user xx -password xx -filepath C:\xx.jpg -url https://xxx:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<project_alias>/testcase/urn:com.ibm.rqm:testcase:51
java -jar RQMUrlUtility.jar -command PUT-user xx -password xx -filepath C:\xx.jpg -url https://xxx:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<project_alias>/testcase/urn:com.ibm.rqm:testcase:51
Thanks in advance,
Rakel
One answer
Comments
I'm using Rational Quality Manager and RQMUrlUtility 5.0 and the attachment gets a "slug" ID. Is it possible to PUT the test artifact to include the attachment URI with that slug ID?
I using the next URL but does not work:
https://xxx:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<project_alias>/testscript/slug__U0NLsO2FEeSp-6dQNzBpqQ
Thank you
If you got this "slug" ID when uploading an attachment, of course it would not work as you were using the ID to find a "testscript" rather than an attachment. You should have the attachment as
This works for RQM 5.0. Know I'm doing some proves with RQM 5.0.2 and RQMUrlUtility 5.0.2 but I'm getting a "slug" ID also, instead of a "proper" ID such as "urn:com.ibm.rqm:attachment:30" in the response header, Content_Location.