It's all about the answers!

Ask a question

RQM REST API - PUT example?


Vaughn Rokosz (111) | asked Aug 10 '09, 3:24 p.m.
JAZZ DEVELOPER
I'm looking for a good example that shows how to use the RQM REST API to update records in RQM (particularly, execution records).

I can retrieve information using the RQMUrlUtility for an execution record:

java -jar RQMUrlUtility.jar -command GET -user vrokosz -password <password> -filepath c:\temp\execrecFail.xml -url https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/executionresult/urn:com.ibm.rqm:executionresult:17

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<<<<<RQMUrlUtility>>>>>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

RQMUrlUtility: Connected to localhost:9443 using project "Quality+Manager"
Aug 10, 2009 3:13:07 PM org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
INFO: Redirect requested but followRedirects is disabled
RQMUrlUtility: Calling method to retrieve XML from a specified URL
RQMUrlUtility: Server Response code: 200
Aug 10, 2009 3:13:07 PM org.apache.commons.httpclient.HttpMethodBase getResponseBody
WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
RQMUrlUtility: XML string retrieved from URL : "https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/executionresult/urn:com.ibm.rqm:executionresult:17 " is written to file located at -: " c:\temp\execrecFail.xml "



But if I try to update that record (using the XML previously retrieved), I get an HTTP code 400:

java -jar RQMUrlUtility.jar -command PUT -user vrokosz -password <password> -filepath c:\temp\execrecFail.xml -url https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/executionresult/urn:com.ibm.rqm:executionresult:17

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<<<<<RQMUrlUtility>>>>>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

RQMUrlUtility: Connected to localhost:9443 using project "Quality+Manager"
Aug 10, 2009 3:17:00 PM org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
INFO: Redirect requested but followRedirects is disabled
RQMUrlUtility: Calling method to upload XML from a specified file to URL
RQMUrlUtility: Server Response code: 400
Aug 10, 2009 3:17:00 PM org.apache.commons.httpclient.HttpMethodBase getResponseBody
WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.


I'd be interested in seeing an XML file that could be used with RQMUrlUtility to update an RQM record.....

14 answers



permanent link
Himanshu Verma (645) | answered Jun 11 '14, 3:04 a.m.
edited Jun 11 '14, 3:05 a.m.
Dear All,
Thanks for the above answers this has solved one of my issues , with the help of above answers I am able to update the execution records in rqm given its ID but i need things like

1. in the given PUT command example we are able to get the xml in the file provided in command , is it possible to get xml packet in return instead of physical file , though i can read xml from the file but sometimes its not possible to create files due to some security reasons.

2. in the above PUT command example we can update the status of the test case execution record given  the execution  table record ID which always increments when any testcase is executed . SO is there any way that we can insert a test case execution record instead of updating it.

3. how can we programmatically execute the test case in rqm with the help of any utility.



permanent link
Dan Gouveia (3186) | answered Aug 15 '11, 10:30 p.m.
Hi -

I am able to get RQMI running. I then run the export from my DOORS module. The problem is that I never see the requirements show up in RQM.

I saw the following snippet of an error in my RQM Tomcat console window:

"RQM Server refused to accept this connection. The returned Test Plan will not contain requirements from the RM server."

Am I missing something that the documentation hasn't explained? Do I need to have the requirements module set up for RQM? In other words, do I need to configure RRC as a container for RQM's requirements? I played around with it but didn't get it working. I recall that the RQM 2.0.1 / DOORS 9.2 integration created RQM requirements. I imagine the same is for the new integration (3.0.1 / 9.3.0.4).

Help!!

permanent link
Robert Rassmann (9923) | answered Aug 08 '11, 5:04 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
I there anyway to populate the "Primary Text" filed for a requirement artifact using the Excel Exporter or any other API?


The primary text field can't be written to with the RQM API. I checked the RRC wiki at https://jazz.net/wiki/bin/view/Main/RRCHome and it mentioned CSV Import and Office Document Import. Maybe one of these would work for you.

- Rob

permanent link
steve martino (6689) | answered Aug 04 '11, 11:38 a.m.
I there anyway to populate the "Primary Text" filed for a requirement artifact using the Excel Exporter or any other API?

permanent link
Abu Md Nasiruddin (2611) | answered Aug 03 '11, 11:06 a.m.
I used the following command
"C:\jazz_2_0_0_2\server\jre\bin\java.exe" -jar RQMUrlUtility.jar -command PUT -user anasirasadsdud@in.ibm.com -password ***** -filepath C:\XML\DownLoadTp1.xml -url https://9.126.40.182:9444/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Ansell/testplan/urn:com.ibm.rqm:testplan:1

i got the error message

2
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<<<<<----- ---->>>>>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

RQMUrlUtility: Connected to https://9.126.40.182:9444 using project "Ansell"
Aug 3, 2011 8:32:35 PM org.apache.commons.httpclient.HttpMethodDirector isRedire
ctNeeded
INFO: Redirect requested but followRedirects is disabled
RQMUrlUtility: Calling method to upload XML from a specified file t
o URL
RQMUrlUtility: Server Response code: 400
Aug 3, 2011 8:32:35 PM org.apache.commons.httpclient.HttpMethodBase getResponseB
ody
WARNING: Going to buffer response body of large or unknown size. Using getRespon
seBodyAsStream instead is recommended.

Can any one help me out from this issue.

I guess I don't quite understand this. If I GET an execution record, modify it, and then PUT it back, doesn't this just update the existing record? I want to show that another execution record has been generated, IE: I executed the testcase again. It seems to me that I need to PUT a new record to show that a second test execution has occurred with new results, and I still want to see the first results, as well. But, how do I PUT a new execution record since I don't know what the executionresult ID is going to be?


I'm looking for a good example that shows how to use the RQM REST API to update records in RQM (particularly, execution records).

I can retrieve information using the RQMUrlUtility for an execution record:

java -jar RQMUrlUtility.jar -command GET -user vrokosz -password <password> -filepath c:\temp\execrecFail.xml -url https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/executionresult/urn:com.ibm.rqm:executionresult:17

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<<<<<RQMUrlUtility>>>>>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

RQMUrlUtility: Connected to localhost:9443 using project "Quality+Manager"
Aug 10, 2009 3:13:07 PM org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
INFO: Redirect requested but followRedirects is disabled
RQMUrlUtility: Calling method to retrieve XML from a specified URL
RQMUrlUtility: Server Response code: 200
Aug 10, 2009 3:13:07 PM org.apache.commons.httpclient.HttpMethodBase getResponseBody
WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
RQMUrlUtility: XML string retrieved from URL : "https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/executionresult/urn:com.ibm.rqm:executionresult:17 " is written to file located at -: " c:\temp\execrecFail.xml "



But if I try to update that record (using the XML previously retrieved), I get an HTTP code 400:

java -jar RQMUrlUtility.jar -command PUT -user vrokosz -password <password> -filepath c:\temp\execrecFail.xml -url https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/executionresult/urn:com.ibm.rqm:executionresult:17

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<<<<<RQMUrlUtility>>>>>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

RQMUrlUtility: Connected to localhost:9443 using project "Quality+Manager"
Aug 10, 2009 3:17:00 PM org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
INFO: Redirect requested but followRedirects is disabled
RQMUrlUtility: Calling method to upload XML from a specified file to URL
RQMUrlUtility: Server Response code: 400
Aug 10, 2009 3:17:00 PM org.apache.commons.httpclient.HttpMethodBase getResponseBody
WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.


I'd be interested in seeing an XML file that could be used with RQMUrlUtility to update an RQM record.....

permanent link
Abu Md Nasiruddin (2611) | answered Aug 03 '11, 10:46 a.m.
I have facing same problem.
I used
"C:\jazz_2_0_0_2\server\jre\bin\java.exe" -jar RQMUrlUtility.jar -command GET -user asasasa@in.ibm.com -password ******* -filepath C:\XML\DownLoadTp1.xml -url https://9.126.40.182:9444/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Ansell/testplan/urn:com.ibm.rqm:testplan:1

<?xml version="1.0" encoding="UTF-8" ?>
- <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://9.126.40.182:9444/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Ansell/testplan/urn:com.ibm.rqm:testplan:2</identifier>
<title xmlns="http://purl.org/dc/elements/1.1/">RP-TP-1</title>
<description xmlns="http://purl.org/dc/elements/1.1/" />
<ns3:updated>2011-08-03T14:25:58.813Z</ns3:updated>
<ns3:state>com.ibm.rqm.planning.common.new</ns3:state>
<creator xmlns="http://purl.org/dc/elements/1.1/">anasirud@in.ibm.com</creator>
<ns3:owner>unassigned</ns3:owner>
<alias xmlns="http://purl.org/dc/elements/1.1/">urn:com.ibm.rqm:testplan:2</alias>
<ns2:testcase href="https://9.126.40.182:9444/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Ansell/testcase/UC_100511_Mass_Created_86_TC_1" />
<ns2:testcase href="https://9.126.40.182:9444/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Ansell/testcase/UC_100511_Mass_Created_7_TC_1" />
<ns2:template href="https://9.126.40.182:9444/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Ansell/template/testplan/com.ibm.rqm.planning.templates.testplan.default" />
<ns2:requirement href="https://9.126.40.182:9444/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Ansell/requirement/UC_100511_Mass_Created_86" />
<ns2:requirement href="https://9.126.40.182:9444/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Ansell/requirement/UC_100511_Mass_Created_7" />
</ns2:testplan>


and it got succeeded.
But when i used PUT instead of GET i got success message but the XML is identical.
Is it possible??
because when put this XML in RQM server i got error response bad request response code 400.
pls can any one help me.


I guess I don't quite understand this. If I GET an execution record, modify it, and then PUT it back, doesn't this just update the existing record? I want to show that another execution record has been generated, IE: I executed the testcase again. It seems to me that I need to PUT a new record to show that a second test execution has occurred with new results, and I still want to see the first results, as well. But, how do I PUT a new execution record since I don't know what the executionresult ID is going to be?


I'm looking for a good example that shows how to use the RQM REST API to update records in RQM (particularly, execution records).

I can retrieve information using the RQMUrlUtility for an execution record:

java -jar RQMUrlUtility.jar -command GET -user vrokosz -password <password> -filepath c:\temp\execrecFail.xml -url https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/executionresult/urn:com.ibm.rqm:executionresult:17

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<<<<<RQMUrlUtility>>>>>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

RQMUrlUtility: Connected to localhost:9443 using project "Quality+Manager"
Aug 10, 2009 3:13:07 PM org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
INFO: Redirect requested but followRedirects is disabled
RQMUrlUtility: Calling method to retrieve XML from a specified URL
RQMUrlUtility: Server Response code: 200
Aug 10, 2009 3:13:07 PM org.apache.commons.httpclient.HttpMethodBase getResponseBody
WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
RQMUrlUtility: XML string retrieved from URL : "https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/executionresult/urn:com.ibm.rqm:executionresult:17 " is written to file located at -: " c:\temp\execrecFail.xml "



But if I try to update that record (using the XML previously retrieved), I get an HTTP code 400:

java -jar RQMUrlUtility.jar -command PUT -user vrokosz -password <password> -filepath c:\temp\execrecFail.xml -url https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/executionresult/urn:com.ibm.rqm:executionresult:17

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<<<<<RQMUrlUtility>>>>>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

RQMUrlUtility: Connected to localhost:9443 using project "Quality+Manager"
Aug 10, 2009 3:17:00 PM org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
INFO: Redirect requested but followRedirects is disabled
RQMUrlUtility: Calling method to upload XML from a specified file to URL
RQMUrlUtility: Server Response code: 400
Aug 10, 2009 3:17:00 PM org.apache.commons.httpclient.HttpMethodBase getResponseBody
WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.


I'd be interested in seeing an XML file that could be used with RQMUrlUtility to update an RQM record.....

permanent link
Ben Tanner (6) | answered Oct 20 '10, 2:18 p.m.
Seeing how the XML returned by the API uses references rather than containment, PUTing to a new server/project area can be tricky. To really succeed you need to follow the references and "doctor" them to point to the new source.
In this example you would try to PUT an executionresult, notice a labresource upon introspection, GET and PUT the dependent labresource, and then modify the labresource referred to in the executionresult to point to the new one you just created before PUTing the executionresult.
I understand you may not need labresource in this particular case but you will keep bumping into this sort of pattern in the future.
BTW, you only need to doctor the "href" and not the "id" (all references have 2 attributes: id and href).
Regards,
John

The problem turned out to be the labresource XML (I was using an execution record generated by the Command line adapter) - see below. Once I took out the labresource entry, the PUT succeeded.


<labresource>



This worked for me! :) thanks!

permanent link
Jim Voge (6) | answered Oct 15 '10, 6:22 p.m.
I guess I don't quite understand this. If I GET an execution record, modify it, and then PUT it back, doesn't this just update the existing record? I want to show that another execution record has been generated, IE: I executed the testcase again. It seems to me that I need to PUT a new record to show that a second test execution has occurred with new results, and I still want to see the first results, as well. But, how do I PUT a new execution record since I don't know what the executionresult ID is going to be?


I'm looking for a good example that shows how to use the RQM REST API to update records in RQM (particularly, execution records).

I can retrieve information using the RQMUrlUtility for an execution record:

java -jar RQMUrlUtility.jar -command GET -user vrokosz -password <password> -filepath c:\temp\execrecFail.xml -url https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/executionresult/urn:com.ibm.rqm:executionresult:17

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<<<<<RQMUrlUtility>>>>>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

RQMUrlUtility: Connected to localhost:9443 using project "Quality+Manager"
Aug 10, 2009 3:13:07 PM org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
INFO: Redirect requested but followRedirects is disabled
RQMUrlUtility: Calling method to retrieve XML from a specified URL
RQMUrlUtility: Server Response code: 200
Aug 10, 2009 3:13:07 PM org.apache.commons.httpclient.HttpMethodBase getResponseBody
WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
RQMUrlUtility: XML string retrieved from URL : "https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/executionresult/urn:com.ibm.rqm:executionresult:17 " is written to file located at -: " c:\temp\execrecFail.xml "



But if I try to update that record (using the XML previously retrieved), I get an HTTP code 400:

java -jar RQMUrlUtility.jar -command PUT -user vrokosz -password <password> -filepath c:\temp\execrecFail.xml -url https://localhost:9443/jazz/service/com.ibm.rqm.integration.service.IIntegrationService/resources/Quality+Manager/executionresult/urn:com.ibm.rqm:executionresult:17

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<<<<<RQMUrlUtility>>>>>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

RQMUrlUtility: Connected to localhost:9443 using project "Quality+Manager"
Aug 10, 2009 3:17:00 PM org.apache.commons.httpclient.HttpMethodDirector isRedirectNeeded
INFO: Redirect requested but followRedirects is disabled
RQMUrlUtility: Calling method to upload XML from a specified file to URL
RQMUrlUtility: Server Response code: 400
Aug 10, 2009 3:17:00 PM org.apache.commons.httpclient.HttpMethodBase getResponseBody
WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.


I'd be interested in seeing an XML file that could be used with RQMUrlUtility to update an RQM record.....

permanent link
Adarsha Mahadeva (6) | answered Jul 15 '10, 2:57 a.m.
Can anyone help me to get the RQM defect ID to a file by using command prompt or script (Perl or batch)

Thanks & Regard,
Adarsha

permanent link
John Nason (2.4k1012) | answered Aug 13 '09, 2:15 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
Seeing how the XML returned by the API uses references rather than containment, PUTing to a new server/project area can be tricky. To really succeed you need to follow the references and "doctor" them to point to the new source.
In this example you would try to PUT an executionresult, notice a labresource upon introspection, GET and PUT the dependent labresource, and then modify the labresource referred to in the executionresult to point to the new one you just created before PUTing the executionresult.
I understand you may not need labresource in this particular case but you will keep bumping into this sort of pattern in the future.
BTW, you only need to doctor the "href" and not the "id" (all references have 2 attributes: id and href).
Regards,
John

The problem turned out to be the labresource XML (I was using an execution record generated by the Command line adapter) - see below. Once I took out the labresource entry, the PUT succeeded.


<labresource>

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.