It's all about the answers!

Ask a question

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


Liora Milbaum (513282117) | 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?

Thanks,
Liora

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).
<ns2:executionresult>
   other elements
   <ns2:attachment href="...link to created attachment.../>
</ns2:executionresult>
 

 
Liora Milbaum selected this answer as the correct answer

Comments
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.


Thanks,
Liora


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.
https://jazz.net/library/article/1376
You can also check out my answer in the bottom of this post where I showed the sequence of creating a test plan.
https://jazz.net/forum/questions/160205/cant-get-a-testplan-modified-by-put-via-poster/160421

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.

Colin.


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

Donald/Colin,


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

Thanks,
Liora 

3 other answers



permanent link
Donald Nong (14.5k414) | answered Aug 26 '14, 9:50 p.m.
https://jazz.net/wiki/bin/view/Main/RQMURLUtility#UPLOAD
What artifact are you going to upload the attachments to?

Comments
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.
FORUM MODERATOR / JAZZ DEVELOPER
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 https://jazz.net/wiki/bin/view/Main/RqmApi#Common_Usage_Scenarios).

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


Comments
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.
FORUM MODERATOR / JAZZ DEVELOPER

Paul Slauenwhite commented Dec 07 '18, 8:57 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

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.