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 |
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.
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?
Donald Nong
commented Apr 29 '15, 1:47 a.m.
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
Then you need to prepare an XML file for the testscript as the payload of the PUT (modify/update) operation, and you add the attachment URL as a member in the XML file. Just do a GET operation against an existing test script with attachments to see what it should look like.
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.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.