It's all about the answers!

Ask a question

How to create a relatedTestCase/relatedChangeRequest link between a RQM Test Case and an RTC Work Item ?


Willy Dhondt (5821018) | asked Jul 18 '17, 3:53 a.m.

Hi,


Thanks for advising on how to create a relatedTestCase/relatedChangeRequest link between a RQM Test Case and an RTC Work Item.


The sequence of PUT's  listed below give the following result:
1) In RQM a link to the work item shows up under "Relate Change Request" of the Test Case
2) In RTC there is no link to the Test Case.
   
The user has the privileges & licenses to create a relatedTestCase/relatedChangeRequest via the RQM Web UI.

Question:
Why is the Related Test Case link not created in RTC ?
 


=============================================================================
AUTHENTICATE>> post https://myhost:9443/ccm/j_security_check
HTTP/1.1 302 Found
post
    - X-Powered-By         Servlet/3.0
    - Location             https://myhost:9443/ccm/secure/authenticated/identity?redirectPath=%2Fccm%2Foslc%2Fworkitems%2Fcatalog
    - Content-Language     en-US
    - Set-Cookie           LtpaToken2=jID/+yT8DZ34XoRx+pJx4H72SgYdfKsDgM6UTWr6hNGyVb7HcojBoG5FTiM/yKajEK9jSXKSUhDeMxO5oER34JojXqGhGU88cuUMya5V09aWCFfsqh7Du5Bq/4w6l9MBLhb2L02tseFWefPD3hYHfbAtJ4hki7CoH8r9grXwkjNmZttdEVpmkA8C5gFydJGxEEg1xr+A2FleioOTj6nnly83H8lWv5GH4hjb9epofuY7fCDyGH0gNcswWM22bWOgL5pWEMNIJgsNaRGnbvaCAqR8HqRsV6Pqljku7sszUz0+3qhtAtq6/3pPTUProdxO; Path=/; Secure; HttpOnly
    - Set-Cookie           WASReqURL=""; Expires=Thu, 01 Dec 1994 16:00:00 GMT; Path=/; Secure; HttpOnly
    - Transfer-Encoding    chunked
    - Date                 Tue, 18 Jul 2017 07:28:49 GMT
    - Expires              Thu, 01 Dec 1994 16:00:00 GMT
    - Cache-Control        no-cache="set-cookie, set-cookie2"
HTTP/1.1 200 OK


.... a number of GET's to collect information

>> put(1) https://myhost:9443/qm/proxy?uri=https%3A%2F%2Fmyhost%3A9443%2Fccm%2Fresource%2FitemName%2Fcom.ibm.team.workitem.WorkItem%2F167%3Foslc.properties%3Doslc_cm%253ArelatedTestCase
>> Request Headers:
    - Accept               application/json
    - Content-Type         application/json
    - OSLC-Core-Version    2.0
    - Accept-Language      en-US,en;q=0.5
    - Accept-Encoding      gzip, deflate, br
    - X-Jazz-CSRF-Prevent  0000sTsMIuzk7vqZOblDfslMYNv:a96bed7d-80ef-4401-8d6a-a23a44f8abff
>> content
{
 "prefixes": {
  "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
  "rtc_cm": "http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/",
  "dcterms": "http://purl.org/dc/terms/",
  "oslc_cm": "http://open-services.net/xmlns/cm/1.0/",
  "calm": "http://jazz.net/xmlns/prod/jazz/calm/1.0/"
 },
 "oslc_cm:relatedTestCase": [{
  "rdf:resource": "https://myhost:9443/qm/oslc_qm/contexts/_GuNbAFS5EeeMvZ59-cIRUA/resources/com.ibm.rqm.planning.VersionedTestCase/_iN7gMV_VEeelX9MkB83u9A",
  "dcterms:title": "350: DOM4-S24B#KP"
 }]
}
>> Response Headers:
    - X-Powered-By         Servlet/3.0
    - x-com-ibm-team-scenario 172.16.9.1
    - X-Powered-By         Servlet/3.0
    - x-com-ibm-team-scenario 172.16.9.1
    - ETag                 "ac1ffe39-23b9-3775-958e-23a54f7d1d26"
    - Last-Modified        Tue, 18 Jul 2017 07:28:56 GMT
    - Expires              Tue, 18 Jul 2017 07:28:56 GMT
    - Vary                 Accept, OSLC-Core-Version
    - Content-Type         application/json;charset=UTF-8
    - Content-Language     en-US
    - Date                 Tue, 18 Jul 2017 07:28:56 GMT
    - Cache-Control        private, must-revalidate, max-age=0, no-cache=set-cookie
    - Content-Length       648
HTTP/1.1 200 OK
>> put(1) https://myhost:9443/qm/oslc_qm/contexts/_GuNbAFS5EeeMvZ59-cIRUA/resources/com.ibm.rqm.planning.VersionedTestCase/_iN7gMV_VEeelX9MkB83u9A
>> Request Headers:
    - Accept               application/xml
    - Accept-Language      en-US,en;q=0.5
    - Accept-Encoding      gzip, deflate, br
    - Content-Type         application/rdf+xml
    - X-Jazz-CSRF-Prevent  0000sTsMIuzk7vqZOblDfslMYNv:a96bed7d-80ef-4401-8d6a-a23a44f8abff
>> content
<rdf:RDF xmlns:dcterms="http://purl.org/dc/terms/" xmlns:oslc_qm="http://open-services.net/ns/qm#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <oslc_qm:TestCase rdf:about="https://myhost:9443/qm/oslc_qm/contexts/_GuNbAFS5EeeMvZ59-cIRUA/resources/com.ibm.rqm.planning.VersionedTestCase/_iN7gMV_VEeelX9MkB83u9A">
    <dcterms:title>DOM4-S24B#KP</dcterms:title>
    <oslc_qm:relatedChangeRequest rdf:ID="n0" rdf:resource="https://myhost:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/167"/>
  </oslc_qm:TestCase>
  <rdf:Description rdf:about="#n0">
    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"/>
    <dcterms:title>167: Bug non testés.</dcterms:title>
  </rdf:Description>
</rdf:RDF>
>> Response Headers:
    - X-Powered-By         Servlet/3.0
    - x-com-ibm-team-scenario 172.16.9.1
    - OSLC-Core-Version    2.0
    - ETag                 "_wh-cwGuKEeeFyasDBznrPg"
    - Location             https://myhost:9443/qm/oslc_qm/contexts/_GuNbAFS5EeeMvZ59-cIRUA/resources/com.ibm.rqm.planning.VersionedTestCase/_iN7gMV_VEeelX9MkB83u9A
    - Content-Language     en-US
    - Content-Length       0
    - Date                 Tue, 18 Jul 2017 07:28:56 GMT
HTTP/1.1 200 OK

3 answers



permanent link
Donald Nong (14.4k314) | answered Jul 19 '17, 1:48 a.m.

Are you sure the colon (:) in the "oslc_cm:relatedTestCase" at the end of your first PUT URL should be escaped twice? It does not look right to me.


Comments
Willy Dhondt commented Jul 19 '17, 10:53 a.m.

Hi Donald,
I got the URL format from  HttpFox that I used to trace the creation of a Related Change Request via the Web UI. 
I adapted my code to remove the double escape, but the result remains the same as with the double escape:
1) In RQM a link to the work item shows up under "Relate Change Request" of the Test Case
2) In RTC there is no link to the Test Case.

>> put(1) https://myhost:9443/qm/proxy?uri=https%3A%2F%2Fmyhost%3A9443%2Fccm%2Fresource%2FitemName%2Fcom.ibm.team.workitem.WorkItem%2F167%3Foslc.properties%3Doslc_cm%3ArelatedTestCase



permanent link
Donald Nong (14.4k314) | answered Jul 19 '17, 9:55 p.m.

I did some testing and found that the simplest way just works - send a PUT request to the RTC work item with the     <oslc_cm:relatedTestCase> content.

So, in your case, send a PUT to https://myhost:9443/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/167 with the <oslc_cm:relatedTestCase> content.

I'm not sure why you chose the proxy service in the first place.


Comments
Willy Dhondt commented Jul 20 '17, 12:15 p.m.

I used the proxy because the web UI uses the proxy.


permanent link
Willy Dhondt (5821018) | answered Jul 20 '17, 12:23 p.m.

Hi Donald,
thanks for your advise, I finally got it solved.

The problem was caused by prefixes in the PUT request body ( copied that from the web UI trace).
After removing the "prefixes" node the links are created in both CCM and QM.

================= successful PUT sequence ===============

>> put(1) https:/myhost/qm/proxy?uri=https%3A%2F%2Fm5l.oc1232020505.ibm.com%3A9443%2Fccm%2Fresource%2FitemName%2Fcom.ibm.team.workitem.WorkItem%2F167%3Foslc.properties%3Doslc_cm%3ArelatedTestCase
>> Request Headers:
    - Accept               application/json
    - Content-Type         application/json
    - OSLC-Core-Version    2.0
    - Accept-Language      en-US,en;q=0.5
    - Accept-Encoding      gzip, deflate, br
    - X-Jazz-CSRF-Prevent  0000v6WP8CUG5l6R5nBF6thGY6D:3adf14e3-b466-4eab-9d71-2886d8dbc600
>> content
{"oslc_cm:relatedTestCase": [{
 "rdf:resource": "https:/myhost/qm/oslc_qm/contexts/GuNbAFS5EeeMvZ59-cIRUA/resources/com.ibm.rqm.planning.VersionedTestCase/_iN7gMV_VEeelX9MkB83u9A",
 "dcterms:title": "350: DOM4-S24B#KP"
}]}
>> Response Headers:
    - X-Powered-By         Servlet/3.0
    - x-com-ibm-team-scenario 172.16.9.1
    - X-Powered-By         Servlet/3.0
    - x-com-ibm-team-scenario 172.16.9.1
    - ETag                 "44ea77cd-fa82-387f-b25f-8b1a67cfe7e7"
    - Last-Modified        Thu, 20 Jul 2017 16:12:28 GMT
    - Expires              Thu, 20 Jul 2017 16:12:28 GMT
    - Vary                 Accept, OSLC-Core-Version
    - Content-Type         application/json;charset=UTF-8
    - Content-Language     en-US
    - Date                 Thu, 20 Jul 2017 16:12:28 GMT
    - Cache-Control        private, must-revalidate, max-age=0, no-cache=set-cookie
    - Content-Length       646
HTTP/1.1 200 OK
>> put(1) https:/myhost/qm/oslc_qm/contexts/_GuNbAFS5EeeMvZ59-cIRUA/resources/com.ibm.rqm.planning.VersionedTestCase/_iN7gMV_VEeelX9MkB83u9A
>> Request Headers:
    - Accept               application/xml
    - Accept-Language      en-US,en;q=0.5
    - Accept-Encoding      gzip, deflate, br
    - Content-Type         application/rdf+xml
    - X-Jazz-CSRF-Prevent  0000v6WP8CUG5l6R5nBF6thGY6D:3adf14e3-b466-4eab-9d71-2886d8dbc600
>> content
<rdf:RDF xmlns:dcterms="http://purl.org/dc/terms/" xmlns:oslc_qm="http://open-services.net/ns/qm#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  <oslc_qm:TestCase rdf:about="https:/myhost/qm/oslc_qm/contexts/_GuNbAFS5EeeMvZ59-cIRUA/resources/com.ibm.rqm.planning.VersionedTestCase/_iN7gMV_VEeelX9MkB83u9A">
    <dcterms:title>DOM4-S24B#KP</dcterms:title>
    <oslc_qm:relatedChangeRequest rdf:ID="n0" rdf:resource="https:/myhost/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/167"/>
  </oslc_qm:TestCase>
  <rdf:Description rdf:about="#n0">
    <rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement"/>
    <dcterms:title>167: Bug non testés.</dcterms:title>
  </rdf:Description>
</rdf:RDF>
>> Response Headers:
    - X-Powered-By         Servlet/3.0
    - x-com-ibm-team-scenario 172.16.9.1
    - OSLC-Core-Version    2.0
    - ETag                 "_OiD2Zm1mEeeI6eQTzQW
-A"
    - Location             https:/myhost/qm/oslc_qm/contexts/_GuNbAFS5EeeMvZ59-cIRUA/resources/com.ibm.rqm.planning.VersionedTestCase/_iN7gMV_VEeelX9MkB83u9A
    - Content-Language     en-US
    - Content-Length       0
    - Date                 Thu, 20 Jul 2017 16:12:28 GMT
HTTP/1.1 200 OK

Your answer


Register or to post your answer.