It's all about the answers!

Ask a question

How to Update RQM Test Plan Sections contents via OSLC


Victor Polo de Gyves Montero (135) | asked Feb 21 '19, 3:51 p.m.

 

Which are the missing steps or instructions to update a Test Plan Section, created by a Test Artifact Template for a Configurations-Enabled RQM project at CLM 6.0.6?


Given the following test plan in RQM, we have created it using a custom test artifact template which adds two sections: “Business Objectives” and “DemoCustomSection”.


Business Objectives” section should contain free-form rich text data. “DemoCustomSection” section should contain a grid with two columns of data.



So, I created the next code to get the XML of the test plan and its ETag:


// Get RDF/XML of test plan

RqmApiClient customClient = new RqmApiClient(jtsUri, username, password);

customClient.login();

HttpClient httpClient = customClient.getHttpClient();

String uri = "https://xxx.xxx.com:9443/"+

 "qm/oslc_qm/contexts/"+

 "_N0wpwfp3EeeN8owPg66FiQ/resources/"+

 "com.ibm.rqm.planning.VersionedTestPlan/"+

 "_gdP8rjRcEemQpdPxJtoG2w"+

 "?oslc_config.context="+conf3 +

 "&abbreviate=false";


HttpGet httpGet = new HttpGet( uri );

httpGet.addHeader("Content-Type", "application/rdf+xml");

httpGet.addHeader("Configuration-Context", conf3 );

HttpResponse response = httpClient.execute( httpGet );

response.getStatusLine();

HttpEntity entity = response.getEntity();

String result = EntityUtils.toString(entity);

writeStringToFile(result, "out/getResourceFromCustomHttp.xml");

String ETag = response.getHeaders( "ETag" )[0].getValue();


Then, I change the file at out/GetResourceFromCustomHttp.xml to update the test plan’s title, description and the values at the sections “Business Objectives” and “DemoCustomSection” using the following code:


// Update test plan

File file = new File(

 "out/getResourceFromCustomHttp.xml");

String resourceFromFile = new String (

 Files.readAllBytes(

   file.toPath()),Charset.forName("UTF-8"))


HttpPut httpPut = new HttpPut( uri );

httpPut.setEntity(new StringEntity( resourceFromFile ));

httpPut.addHeader("Content-Type", "application/rdf+xml");

httpPut.addHeader("Configuration-Context", conf3 );

httpPut.addHeader("If-Match", ETag);

HttpResponse response = httpClient.execute( httpPut );

System.out.println(response.getStatusLine());


After that, the RQM application answers, as expected:


HTTP/1.1 200 OK


BUT only the title and the description of the test plan are updated! No updates of the test section are honored by the RQM API: Cells marked with red circles should show A7 and B7 labels, instead of A and B, so that data was NOT UPDATED. But, title and description, marked with green circles are correctly updated.





The data of Business Objectives was not updated: Data on red circle should say: “This is some default content 7”. But again, no update for both sections.





So, what is wrong/what additional steps or information should be done to update sections for a test plan created using a custom template? Could you provide some example?


As additional information, I include the XML to PUT, with the data updated. Also, some error found on the QM log.


XML used to PUT (update) the test plan:


<?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF

   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

   xmlns:rqm_auto="http://jazz.net/ns/auto/rqm#"

   xmlns:bp="http://open-services.net/ns/basicProfile#"

   xmlns:acp="http://jazz.net/ns/acp#"

   xmlns:cmx="http://open-services.net/ns/cm-x#"

   xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"

   xmlns:calm="http://jazz.net/xmlns/prod/jazz/calm/1.0/"

   xmlns:rqm_lm="http://jazz.net/ns/qm/rqm/labmanagement#"

   xmlns:acc="http://open-services.net/ns/core/acc#"

   xmlns:process="http://jazz.net/ns/process#"

   xmlns:dcterms="http://purl.org/dc/terms/"

   xmlns:oslc="http://open-services.net/ns/core#"

   xmlns:owl="http://www.w3.org/2002/07/owl#"

   xmlns:rqm_process="http://jazz.net/xmlns/prod/jazz/rqm/process/1.0/"

   xmlns:oslc_config="http://open-services.net/ns/config#"

   xmlns:oslc_cm="http://open-services.net/ns/cm#"

   xmlns:skos="http://www.w3.org/2004/02/skos/core#"

   xmlns:rqm_qm="http://jazz.net/ns/qm/rqm#"

   xmlns:oslc_qm="http://open-services.net/ns/qm#"

   xmlns:oslc_rm="http://open-services.net/ns/rm#"

   xmlns:foaf="http://xmlns.com/foaf/0.1/"

   xmlns:oslc_auto="http://open-services.net/ns/auto#"

   xmlns:xsd="http://www.w3.org/2001/XMLSchema#" >

<rdf:Description rdf:about="https://xxx.xxx.com:9443/qm/oslc_qm/contexts/_N0wpwfp3EeeN8owPg66FiQ/resources/com.ibm.rqm.planning.VersionedTestPlan/_gdP8rjRcEemQpdPxJtoG2w#com.ibm.rqm.planning.editor.section.dynamicGridSection_1550165135590">

 <dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">com.ibm.rqm.planning.editor.section.dynamicGridSection_1550165135590</dcterms:identifier>

 <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">DemoCustomSection</dcterms:title>

 <rqm_qm:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string">&lt;div xmlns="http://www.w3.org/1999/xhtml" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml"&gt;{"columnNames":["Column1","Column2"],"value":[[["A7"],["B7"]]]}&lt;/div&gt;</rqm_qm:content>

 <process:projectArea rdf:resource="https://xxx.xxx.com:9443/qm/process/project-areas/_N0wpwfp3EeeN8owPg66FiQ"/>

 <oslc:serviceProvider rdf:resource="https://xxx.xxx.com:9443/qm/oslc_qm/contexts/_N0wpwfp3EeeN8owPg66FiQ/services.xml"/>

 <oslc:instanceShape rdf:resource="https://xxx.xxx.com:9443/qm/oslc_qm/contexts/_N0wpwfp3EeeN8owPg66FiQ/shape/resource/com.ibm.rqm.planning.VersionedTestPlan#RichTextSection"/>

 <rdf:type rdf:resource="http://jazz.net/ns/qm/rqm#RichTextSection"/>

</rdf:Description>

<rdf:Description rdf:about="https://xxx.xxx.com:9443/qm/oslc_qm/contexts/_N0wpwfp3EeeN8owPg66FiQ/resources/com.ibm.rqm.planning.VersionedTestPlan/_gdP8rjRcEemQpdPxJtoG2w#com.ibm.rqm.planning.editor.section.planBusinessObjectives">

 <dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">com.ibm.rqm.planning.editor.section.planBusinessObjectives</dcterms:identifier>

 <dcterms:description rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Define the overall business goals and strategy for your test phase(s).</dcterms:description>

 <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Business Objectives</dcterms:title>

 <rqm_qm:content rdf:datatype="http://www.w3.org/2001/XMLSchema#string">&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;This is some default content 7&lt;/div&gt;</rqm_qm:content>

 <process:projectArea rdf:resource="https://xxx.xxx.com:9443/qm/process/project-areas/_N0wpwfp3EeeN8owPg66FiQ"/>

 <oslc:serviceProvider rdf:resource="https://xxx.xxx.com:9443/qm/oslc_qm/contexts/_N0wpwfp3EeeN8owPg66FiQ/services.xml"/>

 <oslc:instanceShape rdf:resource="https://xxx.xxx.com:9443/qm/oslc_qm/contexts/_N0wpwfp3EeeN8owPg66FiQ/shape/resource/com.ibm.rqm.planning.VersionedTestPlan#RichTextSection"/>

 <rdf:type rdf:resource="http://jazz.net/ns/qm/rqm#RichTextSection"/>

</rdf:Description>

<rdf:Description rdf:about="https://xxx.xxx.com:9443/qm/oslc_qm/contexts/_N0wpwfp3EeeN8owPg66FiQ/resources/com.ibm.rqm.planning.VersionedTestPlan/_gdP8rjRcEemQpdPxJtoG2w">

 <dcterms:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">https://xxx.xxx.com:9443/qm/oslc_qm/contexts/_N0wpwfp3EeeN8owPg66FiQ/resources/com.ibm.rqm.planning.VersionedTestPlan/_gdP8rjRcEemQpdPxJtoG2w</dcterms:identifier>

 <dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-02-19T15:39:13.130Z</dcterms:created>

 <rqm_qm:isLocked rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</rqm_qm:isLocked>

 <dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2019-02-21T18:54:06.212Z</dcterms:modified>

 <rqm_process:hasPriority rdf:resource="https://xxx.xxx.com:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/process-info/_N0wpwfp3EeeN8owPg66FiQ/priority/literal.priority.101"/>

 <process:projectArea rdf:resource="https://xxx.xxx.com:9443/qm/process/project-areas/_N0wpwfp3EeeN8owPg66FiQ"/>

 <dcterms:contributor rdf:resource="https://xxx.xxx.com:9443/jts/users/unassigned"/>

 <rqm_qm:richTextSection rdf:resource="https://xxx.xxx.com:9443/qm/oslc_qm/contexts/_N0wpwfp3EeeN8owPg66FiQ/resources/com.ibm.rqm.planning.VersionedTestPlan/_gdP8rjRcEemQpdPxJtoG2w#com.ibm.rqm.planning.editor.section.dynamicGridSection_1550165135590"/>

 <oslc:instanceShape rdf:resource="https://xxx.xxx.com:9443/qm/oslc_qm/contexts/_N0wpwfp3EeeN8owPg66FiQ/shape/resource/com.ibm.rqm.planning.VersionedTestPlan"/>

 <dcterms:creator rdf:resource="https://xxx.xxx.com:9443/jts/users/vdegyves"/>

 <rqm_qm:template rdf:resource="https://xxx.xxx.com:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/River+North+Product+Development+%28Quality+Management%29/template/testplan/com.ibm.rqm.planning.templates.testplan.template_1550165054266"/>

 <rqm_process:hasWorkflowState rdf:resource="https://xxx.xxx.com:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/process-info/_N0wpwfp3EeeN8owPg66FiQ/workflowstate/com.ibm.rqm.process.testplan.workflow/com.ibm.rqm.planning.common.new"/>

 <dcterms:relation rdf:resource="https://xxx.xxx.com:9443/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/_N0wpwfp3EeeN8owPg66FiQ/testplan/urn:com.ibm.rqm:testplan:52?oslc_config.context=https://xxx.xxx.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Configuration/_U_rskCopEemrUIOJqS244w"/>

 <oslc_config:component rdf:resource="https://xxx.xxx.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Component/_U_YxoCopEemrUIOJqS244w"/>

 <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">DemoTestPlan10 title updated 7</dcterms:title>

 <rqm_qm:shortIdentifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">52</rqm_qm:shortIdentifier>

 <acc:accessContext rdf:resource="https://xxx.xxx.com:9443/qm/acclist#_N0wpwfp3EeeN8owPg66FiQ"/>

 <dcterms:description rdf:datatype="http://www.w3.org/2001/XMLSchema#string">DemoTestPlan10 description updated 7</dcterms:description>

 <oslc:serviceProvider rdf:resource="https://xxx.xxx.com:9443/qm/oslc_qm/contexts/_N0wpwfp3EeeN8owPg66FiQ/services.xml"/>

 <rdf:type rdf:resource="http://open-services.net/ns/qm#TestPlan"/>

 <rqm_qm:richTextSection rdf:resource="https://xxx.xxx.com:9443/qm/oslc_qm/contexts/_N0wpwfp3EeeN8owPg66FiQ/resources/com.ibm.rqm.planning.VersionedTestPlan/_gdP8rjRcEemQpdPxJtoG2w#com.ibm.rqm.planning.editor.section.planBusinessObjectives"/>

 <acp:accessControl rdf:resource="https://xxx.xxx.com:9443/qm/oslc_qm/accessControl/_N0wpwfp3EeeN8owPg66FiQ"/>

 <oslc:shortId rdf:datatype="http://www.w3.org/2001/XMLSchema#int">52</oslc:shortId>

</rdf:Description>

</rdf:RDF>


Also, an error was found at the QM server’s log:


2019-02-21 13:25:13,769 [Default Executor-thread-2577031 @@ 13:25 vdegyves/qm/oslc_qm/contexts/_N0wpwfp3EeeN8owPg66FiQ/resources/com.ibm.rqm.planning.VersionedTestPlan/_gdP8rjRcEemQpdPxJtoG2w] WARN com.ibm.rqm.oslc - No corresponding risk exists in the project area


Comments
Don Yang commented Feb 21 '19, 10:27 p.m.
- I did not test locally but if you manually changed the section contents to the intended update and do a GET, then compare to the XML you PUT, do you see any difference there in terms of section contents you intended to update?
- for the warning messages, it is a known defect:


Victor Polo de Gyves Montero commented Feb 22 '19, 8:13 a.m.

Good idea. I manually changed the section contents. Then I did an HTTP GET to store and edit the returned XML. Then I returned the updated XML with an HTTP PUT. Alas, same result. I read from the answer of Paul Slauenwhite that Sections in the OSLC QM API are read-only. So that's the reason of this issue.

Accepted answer


permanent link
Paul Slauenwhite (8.4k12) | answered Feb 22 '19, 6:20 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Sections in the OSLC QM API are read-only.  Consider using the RQM Reportable REST API (https://jazz.net/wiki/bin/view/Main/RqmApi).

For the WARN in the RQM log, see Multiple instances of WARN com.ibm.rqm.oslc- No corresponding risk exists in the project area in the QM Log (179427).

Victor Polo de Gyves Montero selected this answer as the correct answer

One other answer



permanent link
Jim Amsden (25837) | answered Feb 22 '19, 2:26 p.m.

 You are attempting to PUT to a specific resource URL, TestPlan 52. However, the XML file you are trying to PUT has three resources, not one. I think the rich text and demo custom section are separate linked resources that would require their own PUTs and you'd need to add the links to the test plan.


Comments
Victor Polo de Gyves Montero commented Feb 22 '19, 3:05 p.m. | edited Feb 22 '19, 3:07 p.m.

Also tried that: By providing an XML for the specific resource and PUT to its URI returns HTTP 400. The data of the response contains an XML with the message:


AQXCM5010E A client error occurred while running the HTTP operation, PUT, at this URL: https://xxx.xxx.com:9443/qm/oslc_qm/contexts/_N0wpwfp3EeeN8owPg66FiQ/resources/com.ibm.rqm.planning.VersionedTestPlan/_gdP8rjRcEemQpdPxJtoG2w. The response code is 400.

It seems Paul Slauenwhite's answer is correct. But I don't see how Rqm Reportable REST API supports components to access test artifacts. At least, RQMAPIUtility only provides access to default components.

 


Paul Slauenwhite commented Mar 26 '19, 3:50 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

Note, the RQM Reportable REST API (see https://jazz.net/wiki/bin/view/Main/RqmApi#oslc_config_context) RQM API Utility (see https://jazz.net/wiki/bin/view/Main/RqmApi#RQM_API_Utility and Update REST API Utility to be Configuration Aware (158462)) supports configurations.  Note, the OSLC Cleaner Utility does not support configurations (see Update OSLC Cleaner Utility to be Configuration Aware (168840)). 

Your answer


Register or to post your answer.