Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to create a testscript with an image using the REST API

How can I create a step with an image? Using Poster and doing a get/put on an existing testscript which does contain an image makes the image disappear.

0 votes



6 answers

Permanent link
Rich text sections (e.g. test script manual step) contain references to attachments for attachments (Insert Attachment) and images (Insert Image). You would use the RQM Reportable REST API to PUT the attachment and add the following attachments to your XHTML:

<a href=/<context>/web/dojo/../../service/com.ibm.rqm.planning.service.internal.rest.IAttachmentRestService/<UUID>>

<img src=/<context>/web/dojo/../../service/com.ibm.rqm.planning.service.internal.rest.IAttachmentRestService/<UUID>>

See https://jazz.net/wiki/bin/view/Main/RqmApi#Resources_and_their_Supported_Op (footnote 6).

0 votes


Permanent link
I have tried this but without success.
What exactly is the UUID? Doing a GET on an existing testscript it shows something like "_FUvR4SWZEeG0hKM5A2CkKQ".
But the attachment feed gives me a id like this:
"https://xibmratio.bmsw.bitmarck.org:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/iskv_21c+%28Qualit%C3%A4tsmanagement%29/attachment/urn:com.ibm.rqm:attachment:3"

0 votes


Permanent link
Both IDs are correct. There are several types of IDs in RQM for different usage, you could refer to https://jazz.net/wiki/bin/view/Main/RqmApi#id .

I have tried this but without success.
What exactly is the UUID? Doing a GET on an existing testscript it shows something like "_FUvR4SWZEeG0hKM5A2CkKQ".
But the attachment feed gives me a id like this:
"https://xibmratio.bmsw.bitmarck.org:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/iskv_21c+%28Qualit%C3%A4tsmanagement%29/attachment/urn:com.ibm.rqm:attachment:3"

0 votes


Permanent link
What do I miss? The first xml with the UUID works, the second does not when using the internal IDs.


<?xml version="1.0" encoding="UTF-8"?>
<testscript xmlns="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns:ns10="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1" xmlns:ns11="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1" xmlns:ns12="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1" xmlns:ns2="http://schema.ibm.com/vega/2008/" xmlns:ns3="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns4="http://purl.org/dc/elements/1.1/" xmlns:ns5="http://jazz.net/xmlns/alm/v0.1/" xmlns:ns6="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:ns7="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/" xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1">
<ns4:title>test9</ns4:title>
<scripttype>Manual</scripttype>
<variables/>
<steps><ns6:step ns2:id="_akrHs10uEeGtbtUdPkY3MQ" type="execution">
<ns6:name>MyName</ns6:name>
<ns6:title>MyTitle</ns6:title>
<ns6:description>
<div><p>image:<a href="/qm/web/dojo/../../service/com.ibm.rqm.planning.service.internal.rest.IAttachmentRestService/_qe3Tgl0uEeGtbtUdPkY3MQ">
<img alt="face-smile.png" src="/qm/web/dojo/../../service/com.ibm.rqm.planning.service.internal.rest.IAttachmentRestService/_qe3Tgl0uEeGtbtUdPkY3MQ" /></a> </p></div>
</ns6:description>
</ns6:step>
</steps></testscript>

<?xml version="1.0" encoding="UTF-8"?>
<testscript xmlns="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns:ns10="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1" xmlns:ns11="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1" xmlns:ns12="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1" xmlns:ns2="http://schema.ibm.com/vega/2008/" xmlns:ns3="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns4="http://purl.org/dc/elements/1.1/" xmlns:ns5="http://jazz.net/xmlns/alm/v0.1/" xmlns:ns6="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:ns7="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/" xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1">
<ns4:title>test10</ns4:title>
<scripttype>Manual</scripttype>
<variables/>
<steps><ns6:step ns2:id="_akrHs10uEeGtbtUdPkY3MQ" type="execution">
<ns6:name>MyName</ns6:name>
<ns6:title>MyTitle</ns6:title>
<ns6:description>
<div><p>image:<a href="/qm/web/dojo/../../service/com.ibm.rqm.planning.service.internal.rest.IAttachmentRestService/urn:com.ibm.rqm:attachment:117">
<img alt="face-smile.png" src="/qm/web/dojo/../../service/com.ibm.rqm.planning.service.internal.rest.IAttachmentRestService/urn:com.ibm.rqm:attachment:117" /></a> </p></div>
</ns6:description>
</ns6:step>
</steps></testscript>

0 votes


Permanent link
The following has worked. Is this correct usage?


<?xml version="1.0" encoding="UTF-8"?>
<testscript xmlns="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns:ns10="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1" xmlns:ns11="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1" xmlns:ns12="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1" xmlns:ns2="http://schema.ibm.com/vega/2008/" xmlns:ns3="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns4="http://purl.org/dc/elements/1.1/" xmlns:ns5="http://jazz.net/xmlns/alm/v0.1/" xmlns:ns6="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:ns7="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/" xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1">
<ns4:title>test144</ns4:title>
<scripttype>Manual</scripttype>
<variables/>
<steps><ns6:step ns2:id="_akrHs10uEeGtbtUdPkY3MQ" type="execution">
<ns6:name>MyName</ns6:name>
<ns6:title>MyTitle</ns6:title>
<ns6:description>
<div><p>image:<a href="https://demovmqm:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/HybridSUV-QM/attachment/urn:com.ibm.rqm:attachment:350">
<img alt="face-smile.png" src="https://demovmqm:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/HybridSUV-QM/attachment/urn:com.ibm.rqm:attachment:350" /></a> </p></div>
</ns6:description>
</ns6:step>
</steps></testscript>

0 votes


Permanent link
That works.

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Feb 16 '12, 5:24 a.m.

Question was seen: 9,036 times

Last updated: Feb 16 '12, 5:24 a.m.

Confirmation Cancel Confirm