Issues while creating OSLC link from CCM to AM.
Hello there,
We are trying to create a OSLC link from a workitem in CCM to a model element in AM in Global configuration context.
When we create the link manually it works fine. so we know that the global configuration is setup correctly.
However, when we try to do the same using EWM APIs it doesn't work as expected.
We can see the link in workitem(CCM). But the link is not visible in the model element(AM).
Any suggestions?
Below is the code:
rmmTargetUrl = https://example/am/resource-rmm/2496934?oslc_config.context=https%3A%2F%2Fexample%2Fgc%2Fconfiguration%2F4862
private static void createLinkFromCCMToAM(IWorkItem workitem, String rmmTargetUrl) {
ILinkManager linkManager = (ILinkManager) teamRepository.getClientLibrary(ILinkManager.class);
URI targetURI = URI.create(rmmTargetUrl);
IReference sourceRef = WorkItemLinkTypes.createWorkItemReference(workitem);
IReference targetRef = IReferenceFactory.INSTANCE.createReferenceFromURI(targetURI);
ILink link = linkManager.createLink(WorkItemLinkTypes.ELABORATED_BY, sourceRef, targetRef);
linkManager.saveLink(link, monitor);
}
One answer
The plain Java Client Libraries, by default for CLM links between applications, only create one link and not the back link. In order to get the back link created you might need to provide an advanced property. The code above also lacks the wrapping work item save operation. You can not just create the link. You have to save the work item change with the additional reference added and likely add the advanced property for the backlink.