How to get Associated Work Items from a Change Set using RTC SDK?
Hi,
I need to know how to get the associated workitems from a change set using the RTC SDK. This article shows a solution that could work, however that solution uses an internal class, ServerProviderFactory (and we should avoid using internal classes since those could change in next releases).
Is there any alternative for this without using internal classes?
I´ll appreciate your help.
Thank you,
Accepted answer
Leonardo,
you mentioned ServerProviderFactory so it seems you are looking for Server side code?
Too bad, I only have a Client side example working for me, but it is using only non-internal SDK parts, maybe you can get something similar working on the server?
List<ILink> links
links = ChangeSetLinks.findLinks((ProviderFactory) teamRepository.getClientLibrary(ProviderFactory.class), changeSetHandle, new String[] { ILinkConstants.CHANGESET_WORKITEM_LINKTYPE_ID }, monitor);
for (final ILink link : links) {
final Object resolved = link.getTargetRef().resolve();
if (resolved instanceof IWorkItemHandle) {
// do something with the linked work item
}
If this answers your question, please mark this as accepted.
- Arne
you mentioned ServerProviderFactory so it seems you are looking for Server side code?
Too bad, I only have a Client side example working for me, but it is using only non-internal SDK parts, maybe you can get something similar working on the server?
List<ILink> links
links = ChangeSetLinks.findLinks((ProviderFactory) teamRepository.getClientLibrary(ProviderFactory.class), changeSetHandle, new String[] { ILinkConstants.CHANGESET_WORKITEM_LINKTYPE_ID }, monitor);
for (final ILink link : links) {
final Object resolved = link.getTargetRef().resolve();
if (resolved instanceof IWorkItemHandle) {
// do something with the linked work item
}
If this answers your question, please mark this as accepted.
- Arne
Comments
Leonardo Marzo
May 30 '14, 8:30 a.m.Anyone?
sam detweiler
May 30 '14, 10:11 a.m.I'm not aware of any other method to get the links from a changeset