Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS Work Item Query against TFS Groups

Tags:

tfs

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

like image 782
ajma Avatar asked Sep 17 '09 19:09

ajma


1 Answers

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.

like image 60
scope_creep Avatar answered Oct 05 '22 22:10

scope_creep