It's all about the answers!

Ask a question

RQMUrlutility - Create a new executionworkitem


Bengt Augustsson (161) | asked Nov 21 '11, 3:22 a.m.
We can't create a new executionworkitem through the REST API using RQMUrlutility.

We can succesfully GET a executionworkitem, but using PUT to create a new seems harder then expected.

java -jar RQMUrlUtility.jar -command PUT -user xxxx -password xxxx -filepath c:\rqmurl\ter.xml -url https://xxx/jazz/service/com.i

m.rqm.integration.service.IIntegrationService/resources/project/executionworkitem


The ter.xml file is the same file as the GET but without the tags identification and webId.


Has anyone been succesfull creating new TER? If so, please give me some directions.

/Best Regards, Bengt

11 answers



permanent link
Paul Slauenwhite (8.4k12) | answered Nov 23 '11, 6:53 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
I am assuming you are seeing a 303 (See Other) response code. A TER can only be associated to one test case so if you are PUTting/POSTing a duplicate TER (e.g. same test case), you will get a 303 with the ID of the original TER in the Content Location header of the response.

If you are not receiving a 303 response code, what is the error?

permanent link
Bengt Augustsson (161) | answered Nov 24 '11, 8:50 a.m.
Ok, I have tried with a new test case but without any success.

If we start from the beginning.

Is the following syntax?

java -jar RQMUrlUtility.jar -command PUT -user xxxx -password xxxx -filepath c:\rqmurl\ter.xml -url https://xxxx/jazz/service/com.i 

m.rqm.integration.service.IIntegrationService/resources/project/executionworkitem -context jazz


ter.xml (seems as I can't post it correctly):



<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <ns2:executionworkitem xmlns:ns5="http://jazz.net/xmlns/alm/v0.1/" xmlns:ns6="http://jazz.net/xmlns/alm/qm/v0.1/executionworkitem/v0.1" xmlns:ns7="http://jazz.net/xmlns/alm/qm/v0.1/tsl/v0.1/" xmlns:ns8="http://jazz.net/xmlns/alm/qm/v0.1/executionresult/v0.1" xmlns:ns10="http://jazz.net/xmlns/alm/qm/qmadapter/v0.1" xmlns:ns9="http://jazz.net/xmlns/alm/qm/v0.1/testscript/v0.1/" xmlns:ns11="http://jazz.net/xmlns/alm/qm/qmadapter/task/v0.1" xmlns:ns1="http://schema.ibm.com/vega/2008/" xmlns:ns2="http://jazz.net/xmlns/alm/qm/v0.1/" xmlns:ns3="http://jazz.net/xmlns/alm/qm/v0.1/catalog/v0.1" xmlns:ns4="http://purl.org/dc/elements/1.1/">
<ns4:title>external2</ns4:title>
<ns4:description />
<ns4:creator>EBENAUG</ns4:creator>
<ns5:owner>EBENAUG</ns5:owner>
<ns6:frequency>Once</ns6:frequency>
<ns6:regression>false</ns6:regression>
<ns6:priority />
<ns6:weight>100</ns6:weight>
<ns6:tags />
<ns2:testcase href="https://xxxx/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/xxxx/testcase/urn:com.ibm.rqm:testcase:22720" />
</ns2:executionworkitem>

permanent link
Paul Slauenwhite (8.4k12) | answered Nov 24 '11, 9:10 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Are you using the project area alias (see https://jazz.net/wiki/bin/view/Main/RqmApi#projectAlias) for project in the -url?

permanent link
Bengt Augustsson (161) | answered Dec 14 '11, 8:49 a.m.
Are you using the project area alias (see https://jazz.net/wiki/bin/view/Main/RqmApi#projectAlias) for project in the -url?


If the project alias would be wrong, could I really be succesfull using a GET then? GET is working, POST is not.

Right now I get following error message from the utility - RQMUrlUtility: Server Response code: 415

permanent link
Paul Slauenwhite (8.4k12) | answered Dec 14 '11, 9:05 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Correct.

I believe you are running into https://jazz.net/jazz02/resource/itemName/com.ibm.team.workitem.WorkItem/58732.

permanent link
Bengt Augustsson (161) | answered Jan 16 '12, 3:48 a.m.
Correct.

I believe you are running into https://jazz.net/jazz02/resource/itemName/com.ibm.team.workitem.WorkItem/58732.


How can I use the workaround (using PUT) as PUT needs an item ID, which I don't have as the item should be created?

permanent link
Paul Slauenwhite (8.4k12) | answered Jan 16 '12, 8:31 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
The RQM Reportable REST API can create resources using a PUT request with an external ID (see https://jazz.net/wiki/bin/view/Main/RqmApi#External_ID). For example,

PUT https://<RQM>:<RQM>/<RQM>/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<RQM>/executionworkitem/1234

However, TERs (or executionworkitem) are considered equal when they reference the same test case(s). As such, a PUT request with an external ID turns into an update of the existing TER (or executionworkitem) with a different ID.

permanent link
Khuemy Nguyen (1611) | answered Mar 08 '12, 3:39 p.m.
I'm using RQM Reportable REST API to create TER and ER records using http PUT. I can successfully create TER and ER OK for the first time and they are associated to each other as well as to the right test case and test script. However, I cannot create a new TER if my test case already has a TER and got http 303 error.

What do I need to do to trigger a creation of new TER for a particular test case? Is it in the TER xml file?

Here is my cmd:

PUT https://<RQM>:<RQM>/<RQM>/service/com.ibm.rqm.integration.service.IIntegrationService/resources/<RQM>/executionworkitem/ter123.xml

Thanks,

permanent link
Paul Slauenwhite (8.4k12) | answered Mar 13 '12, 7:38 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
You cannot create more than one test execution record per test case, environment, plan, and milestone.

Comments
Abe Batthish commented May 06 '13, 9:37 a.m.
JAZZ DEVELOPER

Thanks Paul,

Since a TC will be reused in future releases for regression testing, I would like to be able to create a new TER to represent the results per release/iteration/etc...

I'm using the RQMUrlUtil to try out the REST interface and getting a 303.
I'm trying to link the TER to an existing TC that already has a few TERs associated with it.

I have tried to create it against that TC and a new Test Plan for the new release and I'm still getting a 303.

What then is the recommended way to use this interface to generate a new TER against an existing TC, without having to create a new copy of that TC every time?


permanent link
Khuemy Nguyen (1611) | answered Mar 13 '12, 12:41 p.m.
You cannot create more than one test execution record per test case, environment, plan, and milestone.


From GUI I can create new TER for a given test case. Will RQM REST API add support for this in the future? Can I query existing TER for a given test case? If so, please let me know how. At least I can add new ER to existing TER of a test case.

Thanks,

Comments
Paul Slauenwhite commented May 07 '13, 7:44 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

You cannot create more than one test execution record per test case, environment, test plan, and milestone/iteration in the RQM Reportable REST API or RQM UI.  You must have changed one/more of these test execution record properties.

Note, the RQM URL Utility does not support query string (e.g. request parameters) and fragment ID.  I would suggest using Poster and/or HttpRequester.

Using
fields selection/filtering, you can query test execution records based on a given test case.

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.