It's all about the answers!

Ask a question

Linking to work items between different repositories


Arshad Adavani (231220) | asked May 02 '16, 2:16 a.m.
Hi All,

I am trying to create links between different work items FROM DIFFERENT REPOSITORIES.

First of all, is it possible ? If yes, then how can we do it?

I tried the below approach:


private static class WorkItemReferencesModification extends WorkItemOperation {
    private IWorkItemHandle fOpposite;

    public WorkItemReferencesModification(IWorkItemHandle opposite) {
        super("Modifying Work Item References",IWorkItem.FULL_PROFILE);
        fOpposite = opposite;
    }

    @Override
    protected void execute(WorkItemWorkingCopy workingCopy, IProgressMonitor monitor) throws TeamRepositoryException {
        // Create a new reference to the opposite item
        IItemReference reference = IReferenceFactory.INSTANCE.createReferenceToItem(fOpposite);
        // Add the new reference using a specific work item end point
        workingCopy.getReferences().add(WorkItemEndPoints.BLOCKS_WORK_ITEM, reference);
    }
}

It works fine in for the work items in the same repository but did not work for work items between different repositories. I tried creating reference from createReferenceFromURI which also did not work.

Any suggestions ?


Regards,
Arshad

One answer



permanent link
Ralph Schoon (63.1k33646) | answered May 02 '16, 3:50 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
  1. I haven't tried, but the RTC client does it.
  2. You can only link work items between repositories using links that work across repositories. (Tracks, Related Change Request)
  3. You have to set up the relationship between the project areas on both repositories first, to make this work
  4. You have to be logged on in both repositories

It is always clever to try to do something in the tool, before trying to do it using the API.



Comments
Arshad Adavani commented May 02 '16, 4:38 a.m.

Hi Ralph,
Thanks for your suggestion..
But how do I setup relationship between 2 different projects ?


Thanks and regards,
Arshad


Ralph Schoon commented May 02 '16, 4:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

https://jazz.net/wiki/bin/view/Deployment/MultipleCCMAppsUserPerspective#Configuring_the_CLM_Link_Structu

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.