Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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);
System.out.println("page size "+page.getSize()); ---> this is getting the count of changesets correctly
//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
System.out.println("link is empty "+ links.size());-- this is always empty
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

0 votes



3 answers

Permanent link
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);

0 votes


Permanent link
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);


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

0 votes


Permanent link
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.

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Mar 19 '12, 6:07 a.m.

Question was seen: 5,936 times

Last updated: Mar 19 '12, 6:07 a.m.

Confirmation Cancel Confirm