locked
Assigning SharePoint tasks to groups

    Question

  • I've noticed that when I assign a task to a SharePoint group where my useraccount is a member of; that task doesn't appear in the task list under SharePoint-sites in my site.

    When I assign a task directly to my useraccount that task does appear in the task list in my site.

    Is there a way to make tasks assigned to a group where your useraccount is a member to appear in the task list in my site?

     

    I get the same when I use the webpart contentquery in Sharepoint.

    When I filter for content type tasks and use the filter assigned to equals [me] I only see the tasks directly assigned to my useraccount in the list, not those assigned to the group(s) whereto my useraccount belongs.

     

    Is there a workaround or something  

    Thanks in advance.

     

    Davy

     

     

    • Edited by Mike Walsh FIN Monday, March 08, 2010 5:59 PM "because this is really important." deleted. No pressure on forum members please - this is on a part with "this is urgent"
    Thursday, February 28, 2008 8:45 AM

Answers

  • Hi Guys,

    I think I found a solution without having to code a new web part. The idea is to use the Membership comparator, which is used by the "By My Groups" view. The Membership comparator seems to work just like the other comparators ("is equal to", "is greater than", "is less than", etc), but is not available in the "Filter" section of a view.

    Try following these steps:

    • Create a new view, and open the corresponding Aspx in Sharepoint Designer
    • In the source code, locate the ListViewXml tag
    • Inside this tag, locate the Where clause (begins with "<Where"  and ends with "/Where>")
    • Replace the contents of this tag with the following:

     


    <Where><Or><Membership Type=
    "CurrentUserGroups"><FieldRef Name="AssignedTo"/></Membership><Eq><FieldRef Name="AssignedTo"/><Value Type="Integer"><UserID Type="Integer"/></Value></Eq></Or></Where> 

    Save the page, and you're ready to go.

    Work's for me! Please, give me some feedback if you managed it to work too.

    Regards,

    Murilo

    • Edited by Murilo Rodrigues Monday, September 08, 2008 11:47 PM code was not showing right
    • Proposed as answer by Schalk.vanWyk Thursday, January 15, 2009 2:19 AM
    • Marked as answer by Mike Walsh FIN Sunday, March 08, 2009 2:41 PM
    Monday, September 08, 2008 11:45 PM

All replies

  • I am having the same issue. I have 3 kinds of users groups within a project (projectleaders, teammembers and viewers). I want to limit the results of a list based on the person who is logged on (based on group membership).

     

    With regards,

    Michel

     

    Monday, March 17, 2008 12:32 PM
  • Same problem here...

    Does anyone know an overview of wich properties the filter works?

    I have made a custom view (Create View). I can filter on the column 'Assigned To'. I have set this to equal [me]. 

    I understand [me] stands for the tasks that are assigned to the user and not to the group of users..

    Does anyone know what the parameter is of identifying the group in place of the user?


    The problem is that I want to see all tasks for the current user and all tasks assigned for the group of users the current user belongs.
    In other words: A combination of the view "By My Groups" and the view "My Tasks".


    Thanx in advance.
    Wednesday, April 02, 2008 8:05 AM
  • Hi Tim,

     

    I happened to go through the same process of elimination trying to achieve the same results.

     

    I did look through the By My Groups view to see if there was a setting I could copy, however could not identify such a setting.

     

    I presume too that there is a parameter for My Groups like [Me].

     

    Cheers,

     

    Monday, April 28, 2008 2:59 PM
  •  SeanCansdale wrote:

     

     

     

    Resolved our problem by creating a new view and setting the filter to.

     

    Assign To is equal to [Me]

     

    OR

     

    Assigned To is equal to "Name of Group"

    Name of Group is a string

     

    If there are other groups you can click Show More Columns to add them.

     

    Obviously the only problem with this is it Share Point will not know which group the user is associated with, you'll need to be the intelligent interface.

    • Edited by Mike Walsh FIN Monday, March 08, 2010 6:00 PM Do not use full quote. Too much screen space is taken up unnecessarily
    Monday, April 28, 2008 3:15 PM
  • I'm having the same problem.

    I want to create a custom list view to show the tasks assigned to the current user group.

    I'm looking for a keyword similar to [Today] or [Me] or another method to make it possible

    Anyone can help me??


    thanks
    Monday, May 19, 2008 11:00 AM
  • Hi Guys,

    I think I found a solution without having to code a new web part. The idea is to use the Membership comparator, which is used by the "By My Groups" view. The Membership comparator seems to work just like the other comparators ("is equal to", "is greater than", "is less than", etc), but is not available in the "Filter" section of a view.

    Try following these steps:

    • Create a new view, and open the corresponding Aspx in Sharepoint Designer
    • In the source code, locate the ListViewXml tag
    • Inside this tag, locate the Where clause (begins with "<Where"  and ends with "/Where>")
    • Replace the contents of this tag with the following:

     


    <Where><Or><Membership Type=
    "CurrentUserGroups"><FieldRef Name="AssignedTo"/></Membership><Eq><FieldRef Name="AssignedTo"/><Value Type="Integer"><UserID Type="Integer"/></Value></Eq></Or></Where> 

    Save the page, and you're ready to go.

    Work's for me! Please, give me some feedback if you managed it to work too.

    Regards,

    Murilo

    • Edited by Murilo Rodrigues Monday, September 08, 2008 11:47 PM code was not showing right
    • Proposed as answer by Schalk.vanWyk Thursday, January 15, 2009 2:19 AM
    • Marked as answer by Mike Walsh FIN Sunday, March 08, 2009 2:41 PM
    Monday, September 08, 2008 11:45 PM
  • Thanks Murilo, that worked for me!!!!
    Wednesday, January 07, 2009 5:35 PM
  • Hi,

    I have the following requirement with MOSS 2007 workflow:
    Programatically i want to assign workflow task to  multiple sharepoint groups (to AssignedTo property) of Task list. Assume that i have set the property "Allow multiple selection" = true.

    I want to achieve this using c#.Net code.

    For example:
    this.workflowProperties.AssignedTo="MOSSGroup1" + ";" + "MOSSGroup2";  // Like this i can assign a task to multiple sharepoint groups. Each group may have 10-15 users.

    Through UI it is possible (means it can be achievable using MOSS Object model), by mentioning Group1 (press Ctrl+K) automatically sharepoint picks the group from site groups.

    Please let me know how to achieve this using MOSS 2007 object model? After achieving i can use the filter that you have mentioned.

    Thanks in advance.


    with  regards,
    MHK
    • Edited by IT-Madhu Wednesday, March 25, 2009 8:58 PM Content editing
    Wednesday, March 25, 2009 8:55 PM
  • Murilo Rodrigues!

    Thankyou so much for your answer! It worked perfect.

    I've tried so many ways to get this to work - and your solution was so simple. Thankyou :-)


    You answered this 1 day off a year ago :-)
    Monday, September 07, 2009 9:15 AM
  • Murilo .. I am not able to get this to work .. is there any way you can send me your ListViewXml code string .. i have the or that connects both the [assignedto]  equal to [me] and the or condition appears at the beginning .. it is almost like the code does not see the second selection with the or ..
    I am going to continue playing with this .. thank you again for this idea .. I have been so nervous about messing with this code (I am an aspx programmer & all this html is so foreign to me ).
    thanks again for all your help & suggestions ..
    Tuesday, October 13, 2009 7:43 PM
  • I have the same error to, fails to render, can you please tell me how you fix this error!

    Thanks in advance.
    Thursday, November 12, 2009 2:49 PM
  • Yes, this certainly works.  THANK YOU MURILO!  I just search for "where" now.

    There's lots of ways to make it fail to render.  My number one method:  Putting an extra space or a tab or a return in there. 

    So, make sure it's all one long string.  If you put tabs or carriage returns in, you're hosed.  It's got to have no gaps.  If it drops to a second line in Designer, you know you've got a gap.  (ironically, spaces are okay as long as they're within tags.)

    Here's my internal notes:

    There's no magic.

     

    As you build your filter, there is a filter syntax created.  It seems basic.  Nested <And> and <Or> tags.  I couldn't get it to work with nesting the way you would with ()'s.  instead, it's just linear (like the website) - And then Or then And….  Plus there's tags for each type of <Eq> (equals) and <neq> (not equal) criteria.  And for each type of value.

     

    The hidden "my groups" criteria is this. 

    <Membership Type="CurrentUserGroups"><FieldRef Name="AssignedTo"/></Membership>

     

    So, the best way I found to add this in was to build your View completely through the Sharepoint site.  Where you want your "group", pick your field but do a fake [me] or a fake name to find it like "GroupsHere".

     

    Somewhere in the <where> string you made, you'll find this:

    <Eq><FieldRef Name="AssignedTo"/><Value Type="Integer"><UserID Type="Integer"/></Value></Eq>

     

    Just replace that entire string with the "membership" string, and you're good to go.  (The Membership tags do not work with the <Eq> tags on the outside.)

     

    Once you do this, the View modify page won't render the Filter.  But, you can still apparently change all of the other view criteria when you're in there.  (I haven't tested sort changes.  But, adding or removing columns works.)

     

    Wednesday, January 06, 2010 11:12 PM
  • Hi,
     I have an Requirement to meet for Task Group wise in view..

     Task can be assigned to user : AssignedTo Field
     i have Task Group field where iam filling User Group

    i want this to link with View : View Task Groups

    How do i add this statement Task Group = [Me] so that it filters in view ?

    iam not able to change this <Membership Type="CurrentUserGroups"><FieldRef Name="AssignedTo"/></Membership>
    to
    <Membership Type="CurrentUserGroups"><FieldRef Name="TaskGroup"/></Membership>
    Monday, January 25, 2010 6:14 AM
  • I was able to get this snippet of code to work after getting tripped up by a Rendor Error, but either I'm misunderstanding it's usage, or I still don't have it right. With this code replacing the 'User is equal to [Me]' in the Where section, I can see my list entries and Jane can see hers but I can't see Jane's entries and vice-versa. I was expecting to enter the name of the group to which the users belong and hoped that all the group members would see all of the entries. This seems to be a group version of "just show me mine" unless I'm doing something wrong.

    [UPDATE]
    I implemented a form of this solution:
    http://vspug.com/sam/2007/10/16/how-to-restrict-public-access-to-sharepoint-list-views-using-filters/

    Basically, what I did was I created a multi-value user field called List Editors and a workflow that populates it with the 5 people how always need access to the list item. Then used the web editor to do a simple Filter of that field is equal to [Me]. Works great!
    Tuesday, March 09, 2010 5:23 PM
  • Hi Guys

     

    Modifying one page is good to get the desired results but i have 25 task list to manage, any ideas to implement this. Also i am not even able to see tasks assigned to the groups i belong  to under my group tasks.

     

    Thanks

     

    Thursday, April 22, 2010 6:47 PM
  • Hi,

    I'll want to thank you all for your posts.

    The explicitly solution here it does not work for me BUT give me an idea ;-)

    In Sharepoint designer i open "my groups" taks view and COPY query Statement and paste in similar position of my own library custom view.

    I change Name (FieldRef) with my library custom field (like assigned to) and it works!!!

    Thank You Very Very much!! and sorry for revival OLD POST!

    :D:D I HOPE IT WORKS FOR SOMEONE ELSE ! ! ! :D:D

     

    Reference CODE:

    <View Name="...">
     <Query>
     <Where>
       <Membership Type="CurrentUserGroups">
    	<FieldRef Name="PuedeVer"/>
       </Membership>
     </Where>
     </Query>
    <ViewFields>....
    
    

    Monday, June 21, 2010 9:41 PM
  • Thanks for the solution Murilo!!!

    One correction in the above given string. (Guys, only if your view doesn't show any thing even after pasting this string in your new view)

    Replace <"AssignedTo"> with <&quot;AssignedTo&quot;> in string provided by Murilo.

    Updated string:
    &lt;Where&gt;&lt;Or&gt;&lt;Membership Type="CurrentUserGroups"&gt;&lt;FieldRef Name=&quot;AssignedTo&quot;/&gt;&lt;/Membership&gt;&lt;Eq&gt;&lt;FieldRef Name=&quot;AssignedTo&quot;/&gt;&lt;Value Type=&quot;Integer&quot;&gt;&lt;UserID Type=&quot;Integer&quot;/&gt;&lt;/Value&gt;&lt;/Eq&gt;&lt;/Or&gt;&lt;/Where&gt; 

    Also I would like to phrase the context for the solution.

    You can try it on a calendar (I did it).

    1. Create two sharepoint groups with 'Contribute' permissons given to both.

    2. Assign one user in first group (say 'Group A') and two users in second group (say 'Group B').

    3. Let the user in Group A create a meeting and also user in Group B will create a meeting. (So now we have two meetings created by two users associated with two different groups.)

    4. Now follow what Murilo has suggested...

    5. Now login with all 3 users and you will happy to see the results. :-)

    Regards,

     


    Thnx, Youdhbir

    Moderator Note: I deleted yet another off-topic SP 2010 post added to this thread in March 2011. I will now lock the thread. It has already many more than one questions in the thread and is already very unwieldly (and did I mention, old)

    • Edited by Mike Walsh FIN Tuesday, March 29, 2011 5:05 PM Moderator Note added
    Friday, July 23, 2010 5:39 AM