Using RQM REST API to Update TCERs
Hello,
I am trying to use RQM REST API to update TCERs. Currently, I am able to GET all kinds of information, but got problem using PUT/POST. I use the Firefox RESTClient plugin, and have setup headers including
X-Jazz-CSRF-Prevent: FA45F368443...×Content-Type: application/rdf+xml×Accept: application/xml×OSLC-Core-Version: 2.0×
Here are my questions:
1. When I PUT update on an existing TCER, e.g. executionresult:98715, does RQM generate a new result automatically? In this example, I have already had two records in previous results. I am expecting to have the 3rd result generated for me, right?
2. When I PUT the raw xml back to the TCER, it updates okay. However, if I change the status from Pass to Fail in xml, I get 412 Precondition Failed. I notice there is a state ID, <ns2:stateid>_52C8AO9lEeWycOIbQY9n8g</ns2:stateid>, which changes over time, and I am not sure how to update this stateid. e.g. Change TCER status from <ns16:pointspassed>1</ns16:pointspassed><ns16:pointsfailed>0</ns16:pointsfailed> To <ns16:pointspassed>0</ns16:pointspassed><ns16:pointsfailed>1</ns16:pointsfailed>
I appreciate any help in advance.
I am trying to use RQM REST API to update TCERs. Currently, I am able to GET all kinds of information, but got problem using PUT/POST. I use the Firefox RESTClient plugin, and have setup headers including
X-Jazz-CSRF-Prevent: FA45F368443...×Content-Type: application/rdf+xml×Accept: application/xml×OSLC-Core-Version: 2.0×
Here are my questions:
1. When I PUT update on an existing TCER, e.g. executionresult:98715, does RQM generate a new result automatically? In this example, I have already had two records in previous results. I am expecting to have the 3rd result generated for me, right?
2. When I PUT the raw xml back to the TCER, it updates okay. However, if I change the status from Pass to Fail in xml, I get 412 Precondition Failed. I notice there is a state ID, <ns2:stateid>_52C8AO9lEeWycOIbQY9n8g</ns2:stateid>, which changes over time, and I am not sure how to update this stateid. e.g. Change TCER status from <ns16:pointspassed>1</ns16:pointspassed><ns16:pointsfailed>0</ns16:pointsfailed> To <ns16:pointspassed>0</ns16:pointspassed><ns16:pointsfailed>1</ns16:pointsfailed>
I appreciate any help in advance.
Accepted answer
A couple of comments:
-A TCER is a test case execution record. Your internal ID in #1 (executionresult:98715) is for a test case result (see https://jazz.net/wiki/bin/view/Main/RqmApi#Internal_ID).
-PUT requests can be used to update existing artifacts or create new artifacts (https://jazz.net/wiki/bin/view/Main/RqmApi#PUT_requests).
-To update an artifact, you must first create the artifact in the RQM web UI or RQM Reportable REST API (see https://jazz.net/wiki/bin/view/Main/RqmApi#ScenarioCreateTip).
-When updating an artifact, make sure you have the most recent version of that artifact.
-State IDs are read-only (see https://jazz.net/products/rational-quality-manager/api-doc-6.0/schemas/qm_xsd/elements/stateid.html).
-The 412 9Precondition Failed) error response is likely caused by a missing required property. Check the response content or RQM log for more information.
-A TCER is a test case execution record. Your internal ID in #1 (executionresult:98715) is for a test case result (see https://jazz.net/wiki/bin/view/Main/RqmApi#Internal_ID).
-PUT requests can be used to update existing artifacts or create new artifacts (https://jazz.net/wiki/bin/view/Main/RqmApi#PUT_requests).
-To update an artifact, you must first create the artifact in the RQM web UI or RQM Reportable REST API (see https://jazz.net/wiki/bin/view/Main/RqmApi#ScenarioCreateTip).
-When updating an artifact, make sure you have the most recent version of that artifact.
-State IDs are read-only (see https://jazz.net/products/rational-quality-manager/api-doc-6.0/schemas/qm_xsd/elements/stateid.html).
-The 412 9Precondition Failed) error response is likely caused by a missing required property. Check the response content or RQM log for more information.