Linking in ALM
Sudipto Sarkar (63●14●43)
| asked Jul 11 '16, 8:56 a.m.
edited Jul 11 '16, 8:13 p.m. by Donald Nong (14.5k●6●14)
Hello All,
I am working on creating links and backlinks for workitems across servers. I have written the following code : Add a link : private void addLink(WorkItemWorkingCopy workingCopy, IProgressMonitor monitor, IWorkItem sourceWorkItem) throws TeamRepositoryException { IReference targetEndpoint = getTargetEndPoint((ITeamRepository) sourceWorkItem.getOrigin(), sourceWorkItem.getId()); workingCopy.getReferences().add(fIEndPointDescriptor, targetEndpoint); workingCopy.save(monitor); } private IReference getTargetEndPoint(ITeamRepository teamRepo, int workItemID) throws TeamRepositoryException { IWorkItemClient workItemClient = (IWorkItemClient) (teamRepo).getClientLibrary(IWorkItemClient.class); URI myURI = ItemURI.createWorkItemURI(workItemClient.getAuditableCommon(), workItemID); Location location = Location.location(myURI); IReference targetEndpoint = IReferenceFactory.INSTANCE.createReferenceFromURI(location.toAbsoluteUri()); return targetEndpoint; } Add a backlink : private void addBackLink(IWorkItem targetWorkItem, IProgressMonitor monitor) throws TeamRepositoryException { WorkItemWorkingCopy workingCopy = getSourceWorkingCopy(); IReference targetEndpoint = getTargetEndPoint((ITeamRepository) workItem.getOrigin(), targetWorkItem.getId()); workingCopy.getReferences().add(getRequiredBackLink(), targetEndpoint); workingCopy.save(monitor); } getSourceWorkingCopy() method gives me the source work item workingcopy and getRequiredBackLink() returns a backlink. For E.g. if link is tracks then getRequiredBackLink() will return Contributes To. THIS CODE WORKS FOR ME IF THE WORK ITEMS ARE IN THE SAME SERVER: BUT IT DOESN'T WORK ACROSS SERVERS. Any other suggestions ? Thanks for the help in advance. |
One answer
Ralph Schoon (63.5k●3●36●46)
| answered Jul 12 '16, 2:46 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Creating back links works in a different way. See https://rsjazz.wordpress.com/2013/11/06/creating-clm-links-with-back-link/
Where and how back links are stored changes in RTC 6.x as well. I haven't tried to link across CCM repository borders, but I have linked to QM and RM elements and that is across repo and works. Unfortunately the question does not provide much useful symptoms what goes wrong. |
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.
Comments
If you are working across servers, there are a local server (where your code runs) and a remote server. I don't think you can use plain Java API to manipulate work items on the remote server. You need to use API over HTTP (OSLC, internal REST and etc).