Linking to work items between different repositories
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
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
-
I haven't tried, but the RTC client does it.
-
You can only link work items between repositories using links that work across repositories. (Tracks, Related Change Request)
- You have to set up the relationship between the project areas on both repositories first, to make this work
- 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.