It's all about the answers!

Ask a question

API to Create link to Work Item from RQM Test Case

ABHILASH MM (175) | 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.

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

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:
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/"/>
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 (175) | 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/"/>
in the PUT Data i get error Like the tag is invalid

        <oslc:message>AQXCM5044E The request URL https://{hostURL}/qm/oslc_qm/contexts/_OUNNIGjIEeiXbKDSmG_sEA/resources/ contains unsupported link types property</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?

Geoffrey Clemm commented Aug 01 '21, 11:49 p.m. | edited Aug 01 '21, 11:50 p.m.

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.