It's all about the answers!

Ask a question

How to get conflict report API

Yehiel Glass (25538986) | asked May 09 '13, 11:51 a.m.
edited May 20 '13, 4:39 p.m. by Millard Ellingsworth (2.5k12431)


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){




Yehiel Glass commented Jul 14 '13, 4:41 a.m. | edited Jul 15 '13, 11:09 a.m.


How can I get a list of conflict files ?


Accepted answer

permanent link
Tim Mok (6.6k38) | answered Jul 15 '13, 11:55 a.m.
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

Register or to post your answer.