Not able to get the link information for changeset
Hi,
below is the piece of code for getting the changesets for an wotkitem. public static void getChangeSets(IWorkItem workItem) throws TeamRepositoryException { workSpaceManager = SCMPlatform.getWorkspaceManager(teamRepository); IProgressMonitor monitor = new SysoutProgressMonitor(); ILinkManager fLinkManager = (ILinkManager) teamRepository.getClientLibrary(ILinkManager.class); IReferenceFactory fReferenceFactory = fLinkManager.referenceFactory(); IReference reference = fReferenceFactory.createReferenceToItem(workItem.getItemHandle()); ILinkQueryPage page; page = fLinkManager.findLinksByTarget("com.ibm.team.filesystem.workitems.change_set", reference, monitor); //ILinkCollection linkCollection = page.getLinks(); //Collection<ILink> links = linkCollection.getLinksById("com.ibm.team.filesystem.workitems.change_set"); Collection<ILink> links = page.getLinks().getLinksById("com.ibm.team.filesystem.workitems.change_set"); if (links.isEmpty()) --->this is becoming true always else System.out.println("link is not empty"); Iterator<ILink> iter = links.iterator(); while (iter.hasNext()) { ILink link = iter.next(); System.out.println("inside changeset function"); } } I am not able to get the links for changeset from the page . can somebody let me know where I am going wrong |
3 answers
Ralph Schoon (63.5k●3●36●46)
| answered Mar 19 '12, 11:29 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi,
I am not sure what and in which context you are trying this. I would try to use the WorkItemWorkingCopy.getReferences() to get the links on the work item. I haven't tried the way you do it, so i don't have example code. this looks odd, because you just created the reference. page = fLinkManager.findLinksByTarget("com.ibm.team.filesystem.workitems.change_set", reference, monitor); |
Hi, My idea is to get the changesets associated with workitem and also to get the names of programs for this changeset. from the example you give, how to get/identify the changeset references in a workitem. thanks, Sundar |
Ralph Schoon (63.5k●3●36●46)
| answered Mar 20 '12, 7:04 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I found these links:
- https://jazz.net/forums/viewtopic.php?t=4893 - https://jazz.net/forums/viewtopic.php?t=2404 but have no code that works so far. |
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.