How to get WorkItem references from an IChange or IChangeset?
![]()
Hi. . . There are numerous examples online and on the forum of getting references to IChangesets through the WorkItem/WorkItemCopy. Most clearly, from Ralph's blog:
public List<IChangeSet> findChangesetsOnWorkItem(WorkItemWorkingCopy wc) throws RtcException, TeamRepositoryException{ IWorkItemReferences references = wc.getReferences(); Also, in this RTC article (reference "Discovering Links Between Items") by Chris McGee. However, these are examples of finding various links from a workitem. Is there a way to find links from a changeset or from a change? I have an IChangeset and I want to find all the work items that are linked to it. Also, I don't see any reference in the 5.0.2 java API docs for IReference, ILink, or ILinkManager. Does anyone know the reason for that? Thanks! Andy |
Accepted answer
![]()
Ralph Schoon (62.3k●3●36●43)
| answered Sep 11 '15, 3:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Sep 11 '15, 3:35 a.m.
You are starting with a change set and not a work item. In that case this might be more appropriate:
Restrict Delivery of Changesets Associated to Wrong Work Item Types AdvisorAndy Jewell selected this answer as the correct answer
|
One other answer
![]()
This is what I did, based on code referenced in answer:
/** * Get work item links from a changeset * @param chgset Comments Thanks Andy Jewell, your code helped me
Future Users can use below code along with above comment works for Client API
IWorkItem workItem = (IWorkItem) teamRepository.itemManager().fetchCompleteItem(wih, IItemManager.DEFAULT, monitor);
|