How to get conflict report API
Yehiel Glass (255●4●89●86)
| asked May 09 '13, 11:51 a.m.
edited May 20 '13, 4:39 p.m. by Millard Ellingsworth (2.5k●1●24●31) Hello, I need some help to get information about workspace conflict: 1) List of files with conflict 2) Creators (2) of the conflict 3) the related Work-items of the conflict change-sets My code (client side): //get conflicts report Collection<IItemConflictReport> ConflictReport2 = myNewWKSP.conflictReport().conflicts(); for( IItemConflictReport SingleConflict : ConflictReport2){ System.out.println(SingleConflict.getMergeDetails().toArray().toString()); }
Thanks.
|
Accepted answer
The conflicts() call returns the items that are conflicted. If you want the names of the files, you'll have to resolve them. You can use myNewWKSP.configuration(IComponentHandle) to get a configuration where you can determine the path of the file.
To find the users, I guess you want to find the owners of the change sets that are in conflict. You'll have to use the states that you get from the IItemConflictReport to find the change sets that have those states and retrieve the change set owner. For the links, you'll need the ILinkService to fetch the links on the change set. You can go through the links and see which ones are work items then get whatever info you need from them. You could also try using the ChangeSetLinks utility class if you can access it. You'll need a provider factory for it, which you can get like this: ProviderFactory providerFactory = (ProviderFactory) myNewWKSP.teamRepository().getClientLibrary(ProviderFactory.class); Yehiel Glass selected this answer as the correct answer
|
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.
Comments
Hi,
How can I get a list of conflict files ?
Thanks.