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

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

0 votes


Accepted answer

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

1 vote

Comments

 Thank You Vijaykumar

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
× 10,938

Question asked: Sep 08 '15, 2:17 a.m.

Question was seen: 2,125 times

Last updated: Sep 08 '15, 3:37 a.m.

Confirmation Cancel Confirm