RQM REST API: How to link newly created test cases to existing test plan
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 ? |
3 answers
Can you do a GET on
|
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 Correct. Reserved URL characters in external IDs must be URL-encoded (see https://jazz.net/wiki/bin/view/Main/RqmApi#External_ID).
|
@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:
Thanks for your help to get this work,<?xml version="1.0" encoding="UTF-8"?>
Dani
Comments 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.
We created an defect for this problem: Test cases with special character '+' yielding bad requests via REST API
Thanks,
Dani
|
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.
Comments
will you please share the XML for Creating Test cases and the PUT Method?