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

Example code to retrieve related workitems from a workitem? Java API

I would like to retrieve all related workitems/Workitem IDs from a workitem.
For example:-
If workitem 10 has related workitems 11, 12, 13.I would like to retrieve all related workitems 11, 12, 13 from 10.Any example code I can make use of ?

0 votes



2 answers

Permanent link
How about Ralph's blogs?
https://rsjazz.wordpress.com/2012/09/19/the-rtc-workitem-link-api-linking-workitems-to-other-elements/
https://rsjazz.wordpress.com/2012/09/20/the-rtc-workitem-server-link-api-linking-to-work-items-and-other-elements/

1 vote


Permanent link
you can use this code part (for precondition plugins)

ILinkService linkService = (ILinkService) getService(ILinkService.class);
ILinkServiceLibrary linkLibrary = (ILinkServiceLibrary) linkService.getServiceLibrary(ILinkServiceLibrary.class);
IItemReference workItemRef = IReferenceFactory.INSTANCE.createReferenceToItem(sourceworkItem);
ILinkQueryPage linkPage = linkLibrary.findLinks(WorkItemLinkTypes.RELATED_WORK_ITEM, workItemRef);
ILinkCollection relatedWorkItems = linkPage.getAllLinksFromHereOn();

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

Question asked: Jul 03 '16, 7:38 p.m.

Question was seen: 2,107 times

Last updated: Jul 04 '16, 4:17 a.m.

Confirmation Cancel Confirm