How to get change set associated to work item using java client API
Hi All,
I am trying to fetch change set associated to work item using java client API.
following is I could do so far
IItemManager itemManager = (IItemManager)teamRepository.getClientLibrary(IItemManager.class);
LinkManager linkManager = (ILinkManager)teamRepository.getClientLibrary(ILinkManager.class);
IItemReference workItemRef = IReferenceFactory.INSTANCE.createReferenceToItem(workItem);
ILinkQueryPage linkPage=linkManager.findLinks(WorkItemLinkTypes.CHANGE_SET, workItemRef, monitor);
List<IChangeSet> changeSets = new ArrayList<IChangeSet>();
for (ILink link : linkPage.getAllLinksFromHereOn())
{
IChangeSetHandle changeSetHandle = (IChangeSetHandle) link .getSourceRef().resolve();
IChangeSet changeSet=(IChangeSet)itemManager.fetchCompleteItem(changeSetHandle, IItemManager.DEFAULT, monitor);
changeSets.add(changeSet);
}
but,
IChangeSet changeSet=(IChangeSet)itemManager.fetchCompleteItem(changeSetHandle,IItemManager.DEFAULT, monitor);
at this line I am getting null pointer exception.
Is there anything I am missing here?
Thank You
|
Accepted answer
https://jazz.net/library/article/1229
in this link Example 2 would help you to solve your problem vikrant kamble selected this answer as the correct answer
|
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.