It's all about the answers!

Ask a question

Getting change set information from a work item.


Kevin Kingsbury (611310) | asked Oct 12 '08, 6:30 p.m.
I am trying to get change set information from a work item object. I am doing the following to get attempt to get this.


ILinkManager fLinkManager = (ILinkManager) repo.getClientLibrary(ILinkManager.class);
IReferenceFactory fReferenceFactory = fLinkManager.referenceFactory();
IReference reference = fReferenceFactory.createReferenceToItem(workItem.getItemHandle());

ILinkQueryPage page = fLinkManager.findLinksByTarget("com.ibm.team.filesystem.workitems.change_set", reference, monitor);
ILinkCollection linkCollection = page.getAllLinksFromHereOn();
links = linkCollection.getLinksById("com.ibm.team.filesystem.workitems.change_set");


Is there something that I need to be doing differently? When debugging this, it looks like the page object has 5 elements in it that corresponds to the 5 change sets that are associated to the work item. But when I do the getAllLinksFromHereOn(), it returns an empty collection.

What am I doing wrong?

Thanks,
Kevin.

4 answers



permanent link
Patrick Streule (4.9k21) | answered Oct 13 '08, 4:57 a.m.
JAZZ DEVELOPER
Is there something that I need to be doing differently? When
debugging this, it looks like the page object has 5 elements in it
that corresponds to the 5 change sets that are associated to the work
item. But when I do the getAllLinksFromHereOn(), it returns an empty
collection.

What am I doing wrong?

The LinkCollection removes all links that have an unknown link type. So
if the plugin com.ibm.team.filesystem.common.workitems (which
contributes the change set link type) is not available in your runtime,
the change set links will be filtered out.

HTH,
Patrick
Jazz Work Item Team

permanent link
Kevin Kingsbury (611310) | answered Oct 13 '08, 11:05 a.m.
Thanks for the reply Patrick.

One thing that I failed to mention, which may make a difference is that I am trying to create this as a standalone java application using the using the plain java client SDK for RTC.

When I look at the jars that come with the SDK, I dont see one that maps to the com.ibm.team.filesystem.common.workitems package.

Does this make a difference? Do I need to approach this differently since I am writing this as a standalone java client?

Thanks for your help.
Kevin

permanent link
Patrick Streule (4.9k21) | answered Oct 13 '08, 12:24 p.m.
JAZZ DEVELOPER
One thing that I failed to mention, which may make a difference is
that I am trying to create this as a standalone java application
using the using the plain java client SDK for RTC.

When I look at the jars that come with the SDK, I dont see one that
maps to the com.ibm.team.filesystem.common.workitems package.

Does this make a difference? Do I need to approach this differently
since I am writing this as a standalone java client?

What you are trying to do should also work in a plain java client. You
could try to add the missing com.ibm.team.filesystem.common.workitems
jar manually to the classpath (you can copy the jar e.g. from an RTC
client installation).

HTH,
Patrick
Jazz Work Item Team

permanent link
Kevin Kingsbury (611310) | answered Oct 13 '08, 2:01 p.m.
Thanks Patrick.

That worked great.

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.