It's all about the answers!

Ask a question

Why does testplan PUT API blow away current Data (4.0.0.1)?


Matthew Vermilion (1468) | asked Jun 24 '13, 4:34 p.m.
I am having problems using the testplan API.  I am doing a PUT with the this test plan, but certain things I don't specify get blown away.

Here's an example where I wanted to add a testcase linkage to a testplan.  I found out that I first needed to grab the current testcases, then send them in again with the additional one.  Then I noticed that the PUT would blow away my categories, so I got them and sent them back in again.  Now I notice that the environment linkages get unlinked too...

Does someone know the magic to do just an update that does not blow away other data?  I do notice that the description doesn't get cleared and some other stuff on the summary page...

Here's my current XML from the HttpClient log.  It's easier to read if you cut and paste it into your own editor.  Thanks for your help!

Matt

11147 2013-06-24 16:16:54,618 [main] DEBUG httpclient.wire.header - >> "PUT /qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/IBM+Ad+Hoc/testplan/urn:com.ibm.rqm:testplan:1455 HTTP/1.1[\r][\n]"

11163 2013-06-24 16:16:54,634 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.getRequestOutputStream()
11164 2013-06-24 16:16:54,635 [main] DEBUG httpclient.wire.content - >> "<?xml version="1.0" encoding="UTF-8"?>[\r][\n]"
11164 2013-06-24 16:16:54,635 [main] DEBUG httpclient.wire.content - >> "<testplan[\r][\n]"
11165 2013-06-24 16:16:54,636 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns="http://jazz.net/xmlns/alm/qm/v0.1/"[\r][\n]"
11165 2013-06-24 16:16:54,636 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns2="http://schema.ibm.com/vega/2008/"[\r][\n]"
11165 2013-06-24 16:16:54,636 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns3="http://purl.org/dc/elements/1.1/"[\r][\n]"
11165 2013-06-24 16:16:54,636 [main] DEBUG httpclient.wire.content - >> " xmlns:ns4="http://jazz.net/xmlns/prod/jazz/process/0.6/"[\r][\n]"
11165 2013-06-24 16:16:54,636 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns5="http://www.w3.org/1999/02/22-rdf-syntax-ns#"[\r][\n]"
11166 2013-06-24 16:16:54,637 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns6="http://jazz.net/xmlns/alm/v0.1/"[\r][\n]"
11166 2013-06-24 16:16:54,637 [main] DEBUG httpclient.wire.content - >> " xmlns:ns7="http://purl.org/dc/terms/"[\r][\n]"
11166 2013-06-24 16:16:54,637 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/"[\r][\n]"
11167 2013-06-24 16:16:54,638 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/"[\r][\n]"
11167 2013-06-24 16:16:54,638 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns10="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1"[\r][\n]"
11167 2013-06-24 16:16:54,638 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns11="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1"[\r][\n]"
11168 2013-06-24 16:16:54,639 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns12="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1"[\r][\n]"
11168 2013-06-24 16:16:54,639 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns13="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1"[\r][\n]"
11168 2013-06-24 16:16:54,639 [main] DEBUG httpclient.wire.content - >> "[0x9]xmlns:ns14="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1"[\r][\n]"
11169 2013-06-24 16:16:54,640 [main] DEBUG httpclient.wire.content - >> " xmlns:ns16="http://jazz.net/xmlns/alm/qm/styleinfo/v0.1/"[\r][\n]"
11169 2013-06-24 16:16:54,640 [main] DEBUG httpclient.wire.content - >> " xmlns:ns17="http://www.w3.org/1999/XSL/Transform">[\r][\n]"
11169 2013-06-24 16:16:54,640 [main] DEBUG httpclient.wire.content - >> "<category term="Product" value="IBM_QuickFile "/>[\r][\n]"
11170 2013-06-24 16:16:54,641 [main] DEBUG httpclient.wire.content - >> "<category term="Release" value="IBM QuickFile 1.1.0.0"/>[\r][\n]"
11170 2013-06-24 16:16:54,641 [main] DEBUG httpclient.wire.content - >> "<testcase href="https://jazzc01.hursley.ibm.com:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/IBM+Ad+Hoc/testcase/slug__cdCc8M-VEeK8YcBLVF6-0Q"/>[\r][\n]"
11170 2013-06-24 16:16:54,641 [main] DEBUG httpclient.wire.content - >> "<testcase href="https://jazzc01.hursley.ibm.com:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/IBM+Ad+Hoc/testcase/slug__fzOtMNjLEeK8ZMBLVF6-0Q"/>[\r][\n]"
11171 2013-06-24 16:16:54,642 [main] DEBUG httpclient.wire.content - >> "<testcase href="https://jazzc01.hursley.ibm.com:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/IBM+Ad+Hoc/testcase/slug__VXStUNz-EeK8ZMBLVF6-0Q"/>[\r][\n]"
11171 2013-06-24 16:16:54,642 [main] DEBUG httpclient.wire.content - >> "<testcase href="https://jazzc01.hursley.ibm.com:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/IBM+Ad+Hoc/testcase/slug__n73e8N0CEeK8ZMBLVF6-0Q"/>[\r][\n]"
11172 2013-06-24 16:16:54,643 [main] DEBUG httpclient.wire.content - >> "</testplan>[\r][\n]"
11172 2013-06-24 16:16:54,643 [main] DEBUG org.apache.commons.httpclient.methods.EntityEnclosingMethod - Request body sent
11172 2013-06-24 16:16:54,643 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.flushRequestOutputStream()
11172 2013-06-24 16:16:54,643 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.readResponse(HttpState, HttpConnection)
11173 2013-06-24 16:16:54,644 [main] DEBUG org.apache.commons.httpclient.HttpMethodBase - enter HttpMethodBase.readStatusLine(HttpState, HttpConnection)
11173 2013-06-24 16:16:54,644 [main] DEBUG org.apache.commons.httpclient.HttpConnection - enter HttpConnection.readLine()
11173 2013-06-24 16:16:54,644 [main] DEBUG org.apache.commons.httpclient.HttpParser - enter HttpParser.readLine(InputStream, String)
11174 2013-06-24 16:16:54,645 [main] DEBUG org.apache.commons.httpclient.HttpParser - enter HttpParser.readRawLine()
11558 2013-06-24 16:16:55,029 [main] DEBUG httpclient.wire.header - << "HTTP/1.1 200 OK[\r][\n]"

Accepted answer


permanent link
Brian Fleming (1.6k11928) | answered Jun 24 '13, 8:56 p.m.
This is what a PUT operation is supposed to do.  From http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html :
"The PUT method requests that the enclosed entity be stored under the supplied Request-URI."  In other words, a PUT to an existing resource will replace the state of that resource with the state of the resource as defined in the payload of the PUT. 

In your case you should first do a GET on the testplan, update/add whatever is necessary, then PUT the entire XML payload back to the server.  As to why things like the title don't get deleted, its likely RQM is preventing you from deleting mandatory and immutable attributes.
Matthew Vermilion selected this answer as the correct answer

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.