How to add an attachment to a test result from the command line?
Accepted answer
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>
Comments
Colin, I've received by mail the full xml. Checking your suggestion.
Colin, How does the slug returned? The standard output doesn't specify the slug nor I can find an argument which returns it.
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
Sorry for not answering earlier (I was on vacation).
Donald/Colin,
3 other answers
What artifact are you going to upload the attachments to?
not able to get the slug id in the response for the success of the attachment??? please help
Comments
No longer working with the tool. Can't help you. Sorry.
Did you check the Content-Location response header (see https://jazz.net/wiki/bin/view/Main/RqmApi#HTTP_Responses). Also, note https://jazz.net/wiki/bin/view/Main/RqmApi#ResourcesFootnote6.