This post has been migrated from www.experimentsincode.com, we apologise if some of the images or content is missing

This post has been migrated, original date 08 Oct 2009 If you want to retrieve a list of tasks that have been assigned to both a user and the groups he belongs to then use the following query:
<where><or><membership type="CurrentUserGroups"><fieldref name="AssignedTo"></fieldref><eq><fieldref name="AssignedTo"><value type="Integer"><userid type="Integer"></userid></value></fieldref></eq>
</membership></or></where>
<where><or><membership type="CurrentUserGroups"><fieldref name="AssignedTo"></fieldref><eq><fieldref name="AssignedTo"><value type="Integer"><userid type="Integer"></userid></value></fieldref></eq> </membership></or></where> Using this and reflecting the code for the Microsoft.SharePoint.WebPartPages.UserTasksWebPart it is quite easy to make an aggregation webpart to display the list of tasks on a users MySite. The above query was not thought up by myself but comes from Murilo Rodrigues in a response to Assigning SharePoint tasks to groups.