tags:

views:

390

answers:

1

Does anybody know how to create a work item query in TFS that will query users against a TFS group? (ie, AssignedTo = [project]\Contributors)

+1  A: 

Hello,

In visual studio 2008, there is an 'In Group' operator in the query editor. You can use it and specify any TFS group.

If that doesn't work, try this. This is a fairly convoluted way to get the query working, but will work, involves using the group security identifier (SID) to bound the query.

SELECT [System.Id], [System.Title]
FROM WorkItems
WHERE [System.TeamProject] = @project 
AND [System.AssignedTo] IN GROUP  
'S-1-9-1551374245-1204400969-2402986413-2179408616-1-3207752628-1878591311-2685660887-
2074056714' 
ORDER BY [System.Id]

To find the SID of the specific group your interested in, run the tfssecurity.exe utility as Run as Administrator with the /i Contributors and server parameter //server:MyTFSServer. This will return something like the following.

Resolving identity "Contributors"...

SID: S-1-9-1551374245-1204400969-2402986413-2179408616-1-3207752628-1878591311-2685660887- 2074056714

DN:

Identity type: Team Foundation Server application group Group type: Contributors Project scope: Server scope Display name: Contributors Description: Members of this application group can perform all privileged operations on the server.

Its long winded, but once you know the SID, and build the WIQ query, and save it, that will be it.

Hope that helps.

scope_creep
Once last thing, apparently the query editor undertands SID, it somehow recognises them, so says my guru mate.
scope_creep