It's all about the answers!

Ask a question

RQM REST API: How to link newly created test cases to existing test plan


0
2
Athanasios Karapantelakis (61) | asked Jul 06 '12, 9:50 a.m.
Hello everyone.

I have used the REST API to create a bunch of test cases in RQM, using an HTTP PUT request. I do get 201 responses back for every test case created, which means that the requests suceed - I can also view the test cases in RQM's web UI.

The problem comes when I am trying to link those test cases to an existing test plan. I have the test plan identifier (doublechecked to be a valid one), and I encapsulate the test case identifiers into an HTTP PUT request like so:
<ns2:testplan xmlns:ns2="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns="http://purl.org/dc/elements/1.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:ns3="http://jazz.net/xmlns/alm/v0.1/" xmlns:ns4="http://schema.ibm.com/vega/2008/" xmlns:ns5="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:ns6="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/" xmlns:ns7="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:ns8="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1" xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1">
    <identifier xmlns="http://purl.org/dc/elements/1.1/">https://almdev.cl.internal.ericsson.com:443/qm/secure/service/com.ibm.rqm.integration.service.IIntegrationService/resources/DUCI_AXE_IV_PMT/testplan/urn%3acom.ibm.rqm%3atestplan%3a181</identifier>
    <title xmlns="http://purl.org/dc/elements/1.1/">Testing MBT</title>
    <description xmlns="http://purl.org/dc/elements/1.1/">Automatically generated from RQM Plugin</description>
    <ns2:testcase href="https://almdev.cl.internal.ericsson.com:443/qm/secure/service/com.ibm.rqm.integration.service.IIntegrationService/resources/DUCI_AXE_IV_PMT/testcase/MBT_Testing+MBT_testcase_1"/>
    <ns2:testcase href="https://almdev.cl.internal.ericsson.com:443/qm/secure/service/com.ibm.rqm.integration.service.IIntegrationService/resources/DUCI_AXE_IV_PMT/testcase/MBT_Testing+MBT_testcase_2"/>
    <ns2:testcase href="https://almdev.cl.internal.ericsson.com:443/qm/secure/service/com.ibm.rqm.integration.service.IIntegrationService/resources/DUCI_AXE_IV_PMT/testcase/MBT_Testing+MBT_testcase_3"/>
</ns2:testplan>
I do get a 200 response back which according to REST API means the update was successfull.

https://jazz.net/wiki/bin/view/Main/RqmApi#Update

However, I cannot see the test cases linked inside the test plan from the Web UI. Is there something I am missing ?

Comments
SaiKiran Cheemakurthi commented Mar 09 '13, 11:26 p.m.

will you please share the XML for Creating Test cases and the PUT  Method?

3 answers



permanent link
Pramod Chandoria (2.1k11220) | answered Jul 07 '12, 8:51 a.m.
JAZZ DEVELOPER
Can you do a GET on
https://almdev.cl.internal.ericsson.com:443/qm/secure/service/com.ibm.rqm.integration.service.IIntegrationService/resources/DUCI_AXE_IV_PMT/testcase/MBT_Testing+MBT_testcase_1

and check if you get testcase resource's xml on this URL.

Seems all thinks correct. As a advice please do a GET on artifact,
then edit xml to make modification and upload it.
Otherwise you might loose some other info of test plan as
REST API does not support partial update




permanent link
Athanasios Karapantelakis (61) | answered Jul 09 '12, 5:25 p.m.
Hi Pramod.

Thanks for your reply. The root cause was the RQM ID names for the test cases. RQM doesn't seem to like the "+" symbol, so I replaced it with an underscore.

For instance:

MBT_Testing+MBT_testcase_1

was converted to

MBT_Testing_MBT_testcase_1

Regards,
Athanasios


Comments
Paul Slauenwhite commented Mar 11 '13, 6:42 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

Correct.  Reserved URL characters in external IDs must be URL-encoded (see https://jazz.net/wiki/bin/view/Main/RqmApi#External_ID).


permanent link
Dani Simon (70114) | answered Dec 04 '19, 7:36 a.m.
edited Dec 04 '19, 7:37 a.m.

 @Athanasios - Did you rename the testcase? 


For me none of your proposals work. 
I've tried these for my testcase with title test+test:
.../qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/PROJECTAREA/testcase?fields=feed/entry/content/testcase[title='test+test']/
.../qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/PROJECTAREA/testcase?fields=feed/entry/content/testcase[title='test%2Btest']/
.../qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/PROJECTAREA/testcase/test+test
.../qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/PROJECTAREA/testcase/test%2Btest
Either I got a "Bad request" back, or a xml with no testcase information inside:

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title type="text">testcase ATOM feed for project area xy</title>
<id>.../qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/pa/testcase</id>
<link href=".../qm/web/console/" rel="alternate"
/>
<link rel="self" href=".../qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/pa/testcase?fields=feed%2Fentry%2Fcontent%2Ftestcase%5Btitle%3D%27test+test%27%5D%2F*"
/>
</feed>

</pre>

Thanks for your help to get this work,
Dani


Comments
Paul Slauenwhite commented Dec 04 '19, 3:51 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

Dani,


This is a variant of defect 183538: Test Case Result records incorrectly shown as Previous Result Records when exporting Test Case Result to PDFs when PA contains "+" in the name.  However, this defect involves encoding the project area alias whereas your issue is with encoding the fields request/query value.  Note, the entire fields request/query value should be URL-encoded.  If this doesn't work, please open a new defect.

Paul

 


Dani Simon commented Dec 05 '19, 4:09 a.m.

Hi Paul

Thanks for your answer. Unfortunately we can't filter for these testcases with the Rest Api. 

Thanks,
Dani

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.