Upload Attachment to a test artifact with RQM Url Utility (REST API)
Hello everyone,
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
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
I don't think you can do it with one step only. Check the following posts for some ideas.
https://jazz.net/forum/questions/170994/rqm-uploading-attachment-via-rest-apirqmurlutility
https://jazz.net/forum/questions/161897/how-to-add-an-attachment-to-a-test-result-from-the-command-line
Basically, you need to use POST first to upload/create an attachment, GET the URI of the new attachment, and then PUT the test artifact to include the attachment URI.
Note that with RQMUrlUtility 5.0.x, the new attachment will get a "proper" ID such as "urn:com.ibm.rqm:attachment:30", instead of the "slug" ID as for older versions. It appears that RQMUrlUtility no longer displays this ID in the command output, so you need to do a GET against the attachment feed to find out the URI of the new attachment.