It's all about the answers!

Ask a question

API to Create link to Work Item from RQM Test Case


ABHILASH MM (174) | asked Jul 29 '21, 6:26 a.m.

 Hi All,


My requirement is to create a link from RQM Test Case to RTC work Item using API.
The RTC work Items linked to Test Case will appear inside Development Items section of Test Case and in RTC Work Item this Test case is listed as Tested By Test Case.

I was searching for the REST/OSLC API Capability to create Development Items link in Test Case.
unfortunately i do not see any API document which can help me here.

In the OSLC API, The Validates Requirement is listed but not the Development Item links to RTC.
OSLC API URL Sample:
https://<host>:<port>/qm/oslc_qm/contexts/PROJECT_UUID/resources/com.ibm.rqm.planning.VersionedTestCase/_F4bBYH4OEemrkexhc6O1NA?oslc_config.context=https://<host>:<port>/gc/configuration/XXX

This Response never lists the Linked RTC Work Items. Is this the correct behavior?

OSLC API reference used.

CLM Version: 6.0.6

Please help if any alternative is there to create the Link to RTC work Item from Test Case.

Thanks for help
Abhilash

Accepted answer


permanent link
Fabian Lomeli (1013) | answered Jul 30 '21, 7:25 p.m.
edited Jul 30 '21, 7:30 p.m.
Hello Abhilash,
For an opt-out project area you would need to create a link on each side of the relationship.  On test case (ETM artifact) and on the work item (EWM artifact) via each OSLC API.

To add or remove a link using OSLC APIs you will follow these steps, which are the same for creating links as for updating other properties:

  1. Obtain, or GET, the artifact that you want to create the link from
  2. Add or remove the link from the artifact body
  3. Update, or PUT, the modified artifact
For example,
1. I get the RDF representation of a test case using this api:
{{hostname-url}}/{{qm-context}}/oslc_qm/contexts/{{qm-project-area-id}}/resources/com.ibm.rqm.planning.VersionedTestCase/_A_53QPFTEeuCfYxVFk23Yw
2. From the RDF, I added the link to the work item I want to add the link that will display in the "Tests Development Items"
        <oslc_qm:testsChangeRequest rdf:resource="{{hostname=url}}/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/187"/>
3. Using the same url in step #1 but this time using a PUT method, I used the RDF from step #2

Where sections between {{ }} should be replaced by actual data:
{{hostname-url}} by the hostname on your environment: e.g. https://localhost:9443
{{qm-context}} is the context used on QM application, usually 'qm'
{{qm-project-area-id}} is the project area id

The result will be a test case with a link to the work item id:187
ABHILASH MM selected this answer as the correct answer

One other answer



permanent link
ABHILASH MM (174) | answered Aug 01 '21, 11:52 a.m.
edited Aug 01 '21, 11:53 a.m.
 Hello Fabian, Thanks for reply,
I am currently updating the Links from Work Item so that they appear in Test Case side.
But the process explained by you to update in the RQM Test Case is not working for me.
1st: the existing links are not listed in the GET request of Test Case
2nd Even if i add the <oslc_qm:testsChangeRequest rdf:resource="{{hostname=url}}/ccm/resource/itemName/com.ibm.team.workitem.WorkItem/187"/>
in the PUT Data i get error Like the tag is invalid

 <oslc:statusCode>403</oslc:statusCode>
        <oslc:message>AQXCM5044E The request URL https://{hostURL}/qm/oslc_qm/contexts/_OUNNIGjIEeiXbKDSmG_sEA/resources/com.ibm.rqm.planning.VersionedTestCase/_4sFVMffBEeiB8NNfA0ooQw contains unsupported link types property http://open-services.net/ns/qm#testsChangeRequest.</oslc:message>

Headers I am using
Accept: application/rdf+xml
Content-Type: application/rdf+xml (Only for PUT)
OSLC-Core-Version: 2.0
Configuration-Context: GC Context URL

Any Idea about this?

Comments
1
Geoffrey Clemm commented Aug 01 '21, 11:49 p.m. | edited Aug 01 '21, 11:50 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Note that Fabian stated that these are instructions for linking artifacts in an "opt-out" QM project area ... where "opt-out" means that configuration management is not enabled in that project area.    Based on your example, it appears that your QM project area is "opt-in", i.e. has configuration management enabled.   For linking a work item to an opt-in QM artifact, you only create the link on the work item (not on the QM artifact).   The link from the QM artifact to the work item (which is often called a "back-link") is computed by the QM application by querying the LDX database.   


ABHILASH MM commented Aug 02 '21, 12:47 a.m.

Thanks for confirmation clemm.

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.