Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Using Plain Java API to link RTC story to RQM test case problem

I have the following code to link the RQM test case to an existing RTC story. When I run the program, I noticed that the RQM test case link was added to RTC story, but it shows the full URL instead of the test case name. when I go to RQM test case, I couldn't see the RTC story link in development item section. 

However,  if I link them manually, it shows the test case name in RTC story, and the RTC story link shows up in the RQM test case in development item section. 

Is there a way to resolve the test case name automatically and do bi-direction link?

URI uri = new URI(tcURL);
IEndPointDescriptor endpoint = ILinkTypeRegistry.INSTANCE
.getLinkType(WorkItemLinkTypes.TESTED_BY_TEST_CASE)
.getTargetEndPointDescriptor();

IWorkItemClient service = (IWorkItemClient) repo
.getClientLibrary(IWorkItemClient.class);

IWorkItem workItem = service.findWorkItemById(storyId,
IWorkItem.FULL_PROFILE, monitor);

IReference reference = IReferenceFactory.INSTANCE
.createReferenceFromURI(uri);

IWorkItemWorkingCopyManager wcm = service
.getWorkItemWorkingCopyManager();
wcm.connect(workItem, IWorkItem.FULL_PROFILE, monitor);

try {
WorkItemWorkingCopy wc = wcm.getWorkingCopy(workItem);
wc.getReferences().add(endpoint, reference);
IDetailedStatus s = wc.save(null);

if (!s.isOK()) {

throw new TeamRepositoryException("Error saving work item",

s.getException());

}

} finally {
wcm.disconnect(workItem);
}



0 votes



One answer

Permanent link
I am not an expert on the RTC API, but your work item reference does not have a title.

For the backlink in RQM, you need to use the OSLC QM API (see http://open-services.net/bin/view/Main/QmSpecificationV2?sortcol=table;up=#Resource_TestCase).  Note, https://jazz.net/wiki/bin/view/Main/RqmApi#ResourcesFootnote8 for the RQM Reportable REST API.

0 votes

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

Question asked: Sep 04 '12, 11:54 a.m.

Question was seen: 5,883 times

Last updated: Sep 05 '12, 10:21 a.m.

Confirmation Cancel Confirm