Jazz Register Log in
Jazz Forum Welcome to the Jazz Community Forum

Welcome to the Jazz Community Forum

Connect and collaborate with IBM Engineering experts and users

HTTP 412 Error (Precondition Failed - the state identifier is stale) while updating RQM/ETM Test Case Validated By links

ELM Version: 7.0.2
Note: Starting on version 7.x, some slugs were included on DNG UUIDs names. We will now see 'BI_' URL as the current 7.x data model for module bound artifacts and 'TX_' URL for core artifacts, whereas the 'MB_' is now referred to as a "legacy URL'.


Context
I'm developing a tool that fixes Validated By links between ETM Test Cases and DNG Requirement Artifacts. In DNG we create modules containing the requirement artifacts (module bound) to avoid linking other objects (Test Cases, DNG Artifacts) to the base artifacts (core).
  • ETM Validated By link to DNG Module Bound Artifact (BI_UUID) link is correct.
  • ETM Validated By link to DNG Core Artifact (TX_UUID) link is incorrect.
Similar Questions
My PUT requests look like this:
<?xml version="1.0"?>
<rdf:RDF xmlns:rqm_auto="http://jazz.net/ns/auto/rqm#"
<dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Test Case 2</dcterms:title>
<dcterms:creator rdf:resource="https://server.com/jts/users/223028865"/>
<dcterms:description rdf:datatype="http://www.w3.org/2001/XMLSchema#string">null</dcterms:description>
<rqm_qm:scriptStepCount rdf:datatype="http://www.w3.org/2001/XMLSchema#string">0</rqm_qm:scriptStepCount>
<rqm_qm:isLocked rdf:datatype="http://www.w3.org/2001/XMLSchema#boolean">false</rqm_qm:isLocked>
<oslc_qm:validatesRequirement rdf:resource="https://server.com/rm/resources/BI_TQfmEOLYEe2D6ayPxmFHeQ"/>
<rdf:type rdf:resource="http://open-services.net/ns/qm#TestCase"/>
<dcterms:contributor rdf:resource="https://server.com/jts/users/unassigned"/>
<dcterms:created rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2022-06-17T08:06:13.451Z</dcterms:created>
<dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2023-06-13T18:31:31.197Z</dcterms:modified>
<oslc:shortId rdf:datatype="http://www.w3.org/2001/XMLSchema#int">8010</oslc:shortId>
<rqm_qm:shortIdentifier rdf:datatype="http://www.w3.org/2001/XMLSchema#string">8010</rqm_qm:shortIdentifier>
<acc:accessContext rdf:resource="https://server.com/qm/acclist#_ICG6EJS3EeyTEqtlEceqew"/>
<projectICG6EJS3EeyTEqtlEceqew_testCase:customAttributeIWq02JS3EeyTEqtlEceqew rdf:datatype="http://www.w3.org/2001/XMLSchema#string">true</projectICG6EJS3EeyTEqtlEceqew_testCase:customAttribute__IWq02JS3EeyTEqtlEceqew>
<rqm_qm:weight rdf:datatype="http://www.w3.org/2001/XMLSchema#int">100</rqm_qm:weight>
</rdf:Description>
</rdf:RDF>
</xml>

It's worth saying that:
  • ETag is the server's current version of the resource.
  • My example request has variables instead of real IDs - UUIDs, you can identify those by seeing a " : " at the beginning of the variable.
After executing the request I'm getting the following error.
Error: AQXCM5006E
Description: The operation failed because the state identifier, "E-TAG", is stale.

My update algorithm follows the next logic:
  1. Fetch Test Cases information
  2. Updates oslc_qm:validatesRequirement value
  3. Execute HTTP PUT Request to save changes
As you can notice, I'm only modifying the oslc_qm:validatesRequirement property from the test case, so I don't know what I'm doing wrong.

Hopefully someone can help me with my issue :)

0 votes


Accepted answer

Permanent link

One thing I notice that's incorrect is that you are using an oslc_config.context header. You should either use a Configuration-Context header, or a oslc_config.context parameter. See https://docs.oasis-open-projects.org/oslc-op/config/v1.0/ps01/config-resources.html#configcontext. Here is an example URI that specifies the concept URI of a test case with a configuration context: https://localhost:9443/qm/oslc_qm/contexts/_T43jwZwCEe2xw5MmkuLgyg/resources/com.ibm.rqm.planning.VersionedTestCase/_mWjACpwCEe2xw5MmkuLgyg?oslc_config.context=https%3A%2F%2Flocalhost%3A9443%2Fgc%2Fconfiguration%2F2

Juan Arturo Cruz Cardona selected this answer as the correct answer

1 vote

Comments

Hi David!

I'm glad you answered my question :) As you said, all I had to do was set  oslc_config.context as a query parameter rather than a header.

Thanks! 

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 143
× 121
× 61
× 45
× 31
× 29
× 14

Question asked: Jul 06 '23, 3:03 p.m.

Question was seen: 1,008 times

Last updated: Jul 07 '23, 5:50 p.m.

Confirmation Cancel Confirm