It's all about the answers!

Ask a question

How to add an attachment to a test result from the command line?

Liora Milbaum (513283117) | asked Aug 26 '14, 10:04 a.m.
 CLM 4.0.4

I am using the RQM URL Utility to update Test Result attributes, but, I have no idea how to add an attachment.
Is it possible using the same tool or are there other utilities which can do the job?


Accepted answer

permanent link
Colin Thorne (22421619) | answered Aug 27 '14, 10:35 a.m.
reverted Aug 27 '14, 10:44 a.m.
When we do this (although using the REST calls directly rather than using the RQMURLUtility) we take two steps:

Upload the attachment by POSTing to the attachment feed. Presumably this is what the Attachment upload example of using RQMURLUtility is doing. The result of this is a slug that identifies the attachment.

    We then PUT the execution result (see the artifact upload example) to include the link to the uploaded attachment. For example, we add the xml such as the following:
(for some reason I am finding it hard to show all the xml in this answer - it keeps getting truncated).
   other elements
   <ns2:attachment href=" to created attachment.../>

Liora Milbaum selected this answer as the correct answer

Liora Milbaum commented Aug 31 '14, 2:30 a.m. | edited Aug 31 '14, 2:30 a.m.

Colin, I've received by mail the full xml. Checking your suggestion. 

Liora Milbaum commented Aug 31 '14, 4:43 a.m.

Colin, How does the slug returned?  The standard output doesn't specify the slug nor I can find an argument which returns it.


Donald Nong commented Aug 31 '14, 11:40 p.m.

Hi Liora,
The slug Id is randomly generated and returned in the response headers, as mentioned in this article.
You can also check out my answer in the bottom of this post where I showed the sequence of creating a test plan.

Content-Location: slug__g5G-kB7dEeScYPkGZbxYmw

Colin Thorne commented Sep 02 '14, 12:10 p.m.

Sorry for not answering earlier (I was on vacation).

Exactly as Donald said in the previous comment, we use the Content-Location in the response header to get the slug id.


Liora Milbaum commented Nov 09 '14, 10:40 a.m.


How do I retrieve the response header in case I used RQMUrlUtility to POST the attachment?


3 other answers

permanent link
Donald Nong (14.5k414) | answered Aug 26 '14, 9:50 p.m.
What artifact are you going to upload the attachments to?

Liora Milbaum commented Aug 27 '14, 4:37 a.m.

Thanks Donald,

The wiki states how do I upload an attachment but there is not relation to specific artifact. 
I want the add the attachment to a specific test result which already exist.

permanent link
Paul Slauenwhite (8.4k12) | answered Apr 05 '16, 11:57 a.m.
edited Apr 05 '16, 11:58 a.m.
Please use another HTTP client/utility that supports response headers (e.g. HTTP Requester or Poster - see

permanent link
Sonali Jathar (11) | answered Dec 06 '18, 6:19 p.m.

 not able to get the slug id in the response for the success of the attachment??? please help

Liora Milbaum commented Dec 07 '18, 1:48 a.m.

No longer working with the tool. Can't help you. Sorry. 

Paul Slauenwhite commented Dec 07 '18, 7:29 a.m.

Paul Slauenwhite commented Dec 07 '18, 8:57 a.m.

Your answer

Register or to post 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.