Under what conditions does RTC display "full" information of remote change sets ?
Hi,
We have users who have begun using Related Change Requests in one RTC project when delivering changes into separate repositories. No remote SCM. Users have discovered that not all the information about the change set is displayed. For example, in the "local" RTC work item links, snapshot compares, etc things like the work item ID, component aren't displayed when the work item linked to the change set is in the "remote" project. I have done some research and have found:
There is not much discussion on jazz.net about this scenario. |
One answer
From the "For What It's Worth" department:
Our users shared a java file with us, which was very like this post. In the method that actually output results was this: Collection<IChangeSetLinkSummary> linkSummaries = workspaceManager.getChangeSetLinkSummary(changeSets, new SysoutProgressMonitor()); // Collect all of the link handles for the change sets so that we can do one fetch of all of the links List<ILinkHandle> linkHandles = new ArrayList<ILinkHandle>(); for (IChangeSetLinkSummary linkSummary: linkSummaries) { linkHandles.addAll(linkSummary.getLinks()); } // Some of the change sets could be attached to the same work item. Although work item handles // do have a unique ID those objects don't implement equals so we use a map of a work item handle // UUID to a work item handle with that UUID. HashMap<UUID, IWorkItemHandle> workItemHandles = new HashMap<UUID, IWorkItemHandle>(); for (Object o: itemManager.fetchCompleteItems(linkHandles, IItemManager.DEFAULT, new SysoutProgressMonitor())) { ILink link = (ILink) o; // Any links that aren't item references are not work item links so discard them now if (link.getTargetRef().isItemReference()) { IItemHandle itemHandle = (IItemHandle) link.getTargetRef().resolve(); if (itemHandle instanceof IWorkItemHandle) { workItemHandles.put(itemHandle.getItemId(), (IWorkItemHandle)itemHandle); } } } // Fetch all of the work items so that we can inspect the approvals for (Object item: itemManager.fetchCompleteItems(new ArrayList<IItemHandle>(workItemHandles.values()), IItemManager.DEFAULT, new SysoutProgressMonitor())) { IWorkItem workItem = (IWorkItem)item; System.out.println("[" + workItem.getId() + "] " + workItem.getHTMLSummary().getPlainText()); } The test in bold was failing for some of the returned ILink, so I dug a little and found a getComment() method link.getTargetRef().getComment()which I used as an else part to that if ...... if (itemHandle instanceof IWorkItemHandle) { workItemHandles.put(itemHandle.getItemId(), (IWorkItemHandle)itemHandle); } } else System.out.println(link.getTargetRef().getComment()); That last System.out.println gave info very like what is displayed in the RTC UI's. There is also a getExtraInfo() method on the IReference object that in this case provides the PublicURI of the remote change and an ID ( which seems to be constant ) |
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.