Use the SharePoint My Tasks Web Part outside of My Sites

Ever wanted to get the functionality of the “My Tasks” web part, outside your SharePoint 2013 My Site? My team did – adding it to our regular Consultant Dashboard would complete the picture of a comprehensive central employee central dashboard where all one’s tasks, issues, and other key metrics are available in one spot.
1

The first question is, how to get the My Tasks widget, which essentially seems to be a web part, exported and re-usable elsewhere. This web part is joined at the hip to the Work Management Service and is not available via the GUI to be re-deployed elsewhere as a standard web part.

Although it seems that perhaps in SP 2013 pre-RTM the web part was available to be deployed as a web part via the web part category “Content Rollup” > My Tasks, it ain’t there currently. Would love to know why it was apparently pulled, but that’s not going to distract from the mission at hand.

Simply exporting the web part and importing elsewhere results in a dismal blankness. No errors, no data either. The web part really seems to want to live in the My Site context.

What worked for me was:

1. Going to a “Tasks” page on a My Site, and exporting the Tasks Web Part
2. Using SharePoint Designer to copy the related sub-pages that are linked from the top menu (AllTasks.aspx, Highlights.aspx, Settings.aspx, RecentlyAssigned.aspx, EditTask.aspx, & CompletedTasks.aspx) from the root of the My Site into the destination team site – this allows you to still access those views from the destination site
3. Edit those sub-pages to remove the Personal redirect control reference: <SPSWC:PersonalSpaceRedirect runat=”server”/> That will prevent visitors to the view pages from being redirected to a non-existent My Site.
4. Import the Tasks Web Part into the destination Site.

All is well, we are now rocking with the My Tasks web part added on whatever page we desire:
2

You can customize the XML manifest for the web part to taste as well:

<webParts>
 <webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
 <metaData>
 <type name="Microsoft.Office.Server.WorkManagement.UI.TaskListWebPart, 
Microsoft.Office.Server.WorkManagement.UI, Version=15.0.0.0, Culture=neutral, 
PublicKeyToken=71e9bce111e9429c" />
 <importErrorMessage>Cannot import this Web Part.</importErrorMessage>
 </metaData>
 <data>
 <properties>
 <property name="HelpUrl" type="string" />
 <property name="Hidden" type="bool">False</property>
 <property name="ChromeType" type="chrometype">Default</property>
 <property name="AllowClose" type="bool">True</property>
 <property name="ShowRefreshStatus" type="bool">True</property>
 <property name="ExportMode" type="exportmode">All</property>
 <property name="AllowMinimize" type="bool">True</property>
 <property name="AllowEdit" type="bool">True</property>
 <property name="Direction" type="direction">NotSet</property>
 <property name="AllowConnect" type="bool">True</property>
 <property name="MissingAssembly" type="string">Cannot import this Web Part.</property>
 <property name="TaskListType" type="Microsoft.Sharepoint.WorkManagement.TaskListType, 
Microsoft.Office.Server.WorkManagement.UI, Version=15.0.0.0, Culture=neutral, 
PublicKeyToken=71e9bce111e9429c">Active</property>
 <property name="TimelineViewData" type="string" null="true" />
 <property name="HelpMode" type="helpmode">Modeless</property>
 <property name="Description" type="string"></property>
 <property name="TitleIconImageUrl" type="string" />
 <property name="CatalogIconImageUrl" type="string" />
 <property name="ChromeState" type="chromestate">Normal</property>
 <property name="AllowZoneChange" type="bool">True</property>
 <property name="LastQueryTime" type="datetime" />
 <property name="Height" type="string" />
 <property name="ShowViewSelector" type="bool">False</property>
 <property name="Width" type="string" />
 <property name="Title" type="string">My Tasks</property>
 <property name="AllowHide" type="bool">True</property>
 <property name="TitleUrl" type="string">~sitecollection/AllTasks.aspx</property>
 </properties>
 </data>
 </webPart>
 </webParts>

The only task remaining that would really smooth it is to figure out how to modify the “views” inside the My Tasks Web Part properties – for example, it’d be  desirable to filter out Completed tasks from the “ProjectSites” view. No idea where that view lives though. 😉

Dashboard, My Tasks, work management

Comments (11)

  • This is awesome. Thanks for the posting… Unfortunately I’ve run into an issue. I get the web part displaying just fine but when I copy over the pages, I get a “File not found” error. Not that it couldn’t find the web page (ex: RecentlyAssigned.aspx), its when that page displays, it seems to not find the corresponding task… Any ideas? I am using Office 365/SharePoint 2013 Online… thx

    • That sounds vaguely familiar.. are you sure you’ve explicitly gone into the ellipsis and selected the Task List containing the task you are looking for? It’s an OOTB behaviour which would be exhibited on that web part in it’s native My Tasks home as well- you have to actively select the project groups via checkboxes, the tasks don’t just show up by default.

      • Thank you for the response. I apologize for not being more clear in my first posting. I should have followed thru a couple more tests. That what I get when I’m in a hurry… anyway… Where the error is coming up is… when a task is created and assigned somewhere in SharePoint, Windows displays a little panel (toaster or toast pop-up?), letting the user know a new task has been assigned. It’s when that link is clicked on that the RecentlyAssigned.aspx page is displayed but cannot find the actual task record… Sorry, again for not being more detailed…

  • I have exported the my tasks webpart from mysite and added them to a page layout in another site collection. I have all the other pages in the same site collection like editTask etc. But i still get redirected to the users my site?

    Any clues?

  • Hey Keith,

    Its very helpful post, thanks for posting this…
    But I have a query, I did it same, but I want to update webpart’s result Sources… Is it possible ?
    Currently it shows results from OOTB result source, but I want to replace OOTB result source from mine…

    • This would be the same answer as the previous question you’d had: I don’t think so, I gave it a good try but everything seems to be ‘black-boxed’ inside the Work Management code. It’s not a ‘normal’ web part in any sense.

  • Hey Keith,
    Thanks for posting this, but I want to change content type used in this webpart OOTB, I want to use my custom content type in it. Is there any way to do this ?

Leave a Reply

Your email address will not be published. Required fields are marked *