It's all about the answers!

Ask a question

How to get ProviderFactory on client ?

Arne Bister (2.6k12832) | asked Mar 22 '14, 3:53 a.m.

<self-answered question>

Suppose you want to get ChangeSetLinks programmatically on a client.
You found ChangeSetLinks.findLinks(providerFactory, changeSetHandle, linkTypeIds, monitor)

You have a changeSetHandle, get the linkTypeIds by:
new String[] { ILinkConstants.CHANGESET_WORKITEM_LINKTYPE_ID }
(as seen in Ralph Schoons Blog)

But how to obtain a providerFactory on the client?

One answer

permanent link
Arne Bister (2.6k12832) | answered Mar 22 '14, 3:56 a.m.
edited Mar 22 '14, 3:58 a.m.
The providerFactory can be obtained by:
(ProviderFactory) teamRepository.getClientLibrary(ProviderFactory.class)


List<ILink> links ChangeSetLinks
   (ProviderFactory) teamRepository.getClientLibrary(ProviderFactory.class),
    new String[] { ILinkConstants.CHANGESET_WORKITEM_LINKTYPE_ID },

will get you all work item links from a change set handle.

sam detweiler commented Mar 22 '14, 7:20 a.m.

very cool. thanks Arne!

mow, in my copy stream utility, I really need to fixup all the links, because all the workitem numbers have changed,.   I know what the new workitem number is for all the old info.

I haven't looked.. is there an easy way to create the links too?

I'm assuming like all other cases,  the link itself is immuatable, so has to be deleted and recreated to have the right ends.

Arne Bister commented Mar 24 '14, 6:25 a.m.

Sam, I have not dabbled with link creation too much yet, but once I do and I find an easy way, I will share.
- Arne

Your answer

Register or 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.