It's all about the answers!

Ask a question

How to get Associated Work Items from a Change Set using RTC SDK?


Leonardo Marzo (24954852) | asked May 29 '14, 9:46 a.m.
 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, 

Comments
Leonardo Marzo commented May 30 '14, 8:30 a.m.

Anyone? 


sam detweiler commented May 30 '14, 10:11 a.m.

I'm not aware of any other method to get the links from a changeset

Accepted answer


permanent link
Arne Bister (2.6k12432) | answered Jun 25 '14, 2:05 p.m.
JAZZ DEVELOPER
edited Jun 25 '14, 2:06 p.m.
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
Leonardo Marzo selected this answer as the correct answer

Your answer


Register or to post your answer.