Summary

This project is intended to create a bridge between TFS WorkItems and SharePoint External Lists.
It enables all CRUD operations on SharePoint side together with a seamless synchronization to/from TFS side.
It uses SharePoint Business Communication Services Administration Object Model to dynamically create external content types from existing TFS WorkItem definitions.
BCS ECTs are based on WIT fields and not on controls - fields and controls are different entities in WIT. If you want to see WIT controls like, for example, drop down boxes with Available Values and Permitted Values you have to create custom List View Forms and link them to the relevant TFS Web Access pages (see appendix).

Project Features

Features implemented in this release:

  • Project parameters are set at SharePoint Administration page.
  • BDC External Content types are created dynamically at runtime from corresponding TFS WorkItem types, where every TFS WorkItem type is linked to separate ECT.
  • There is an additional shared Attachments ECT used by all WorkItem types.
  • Connection to TFS server can be validated before creating BDCM.
  • TFS WorkItem definitions can be exported as a ZIP file.

Features that will be implemented in next releases:

  • AssociationNavigator operation between WorkItem ECT and Attachment ECT.
  • StreamAccessor operation for Attachments ECT.
  • ECT for WorkItem links.
  • All BDC External Content Types will have alternative Edit/View Forms based on TFS Web Access forms.
  • TFS will have alternative login credentials different from original SharePoint login.
  • Export TFS collections/projects hierarchy to XML file.
  • showWaitScreenWithNoClose will be updated as DBCM creation progresses.

Main Project Menu

Main project menu is located at site settings page - settings.aspx

clip_image002

Set BDC External System Properties

clip_image004

Property name Default value Property description
TFS connection URL http://???:8080/tfs/DefaultCollection TFS connection URL
LobSystem Name TFSWITCustomConnector BDC model name
TFS Project Name TeamProject TFS project name
Connect with Current User Identity true Login to TFS with current SharePoint security context.
Connect with Impersonated Windows Identity false Login to TFS with credentials from SharePoint Secure Store Services.
Secure Store Application ID   Pull TFS user credentials from SharePoint Secure Store using this application ID.
Required Fields System.Title Required fields when creating new WorkItem or updating existing WorkItem. WorkItem fields that are visible in the list’s “Create New” form.
Fields shown in List View System.Id,System.Title, System.AssignedTo, System.State, System.WorkItemType WorkItem fields that are visible in the default list’s “ReadList” view.
Fields shown in Item View   WorkItem fields that are visible in the list’s “Display” and “Edit” forms.
ReadOnly Fields Microsoft.VSTS.Common.StateChangeDate, Microsoft.VSTS.Common.ActivatedDate, Microsoft.VSTS.Common.ActivatedBy, Microsoft.VSTS.Common.ResolvedDate, Microsoft.VSTS.Common.ResolvedBy, Microsoft.VSTS.Common.ClosedDate, Microsoft.VSTS.Common.ClosedBy, System.CreatedDate, System.CreatedBy, System.ChangedBy, System.History WorkItem fields that are hidden from the list’s “Create New” and “Edit” forms. These fields are read-only and are mostly updated by TFS code when WorkItem State field changes.
Fields shown in List View   Fields for the list’s “ReadList” view for Attachments ECT.
Fields shown in Item View   Fields for the list’s “Edit” and “Display” forms for Attachments ECT.
Attachments Entity Name Attachments Attachments ECT name.
  SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = '???' AND [System.WorkItemType] = '???' ORDER BY [System.Id] TFS WIQ that is used as an input filter for external list. Can be changed in the Edit List View, parameter: Data Source Filters.
  SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = '???' ORDER BY [System.Id] TFS WIQ for Attachments ECT.

Export TFS WorkItem Schema

clip_image006 clip_image007

Create BDC External System

After clicking on “Create BDC External System” link the wait dialog appears and it can take up to a number of minutes till all ECTs will be created.

clip_image008

After that External Lists should be manually created and linked to new ECTs.

clip_image009

Comparing Team Web Access and SharePoint BDCM views

clip_image011clip_image013

clip_image015

Appendices

TFS Web Access Forms-based authentication

http://geekswithblogs.net/terje/archive/2010/03/03/how-to-enable-forms-authentication-in-team-foundation-server-2010.aspx

TFS Web Access forms

View/Edit http://???:8080/tfs/web/UI/Pages/WorkItems/WorkItemEdit.aspx?id={???}&pguid={???}
Create http://???:8080/tfs/web/UI/Pages/WorkItems/WorkItemEdit.aspx?wit=Bug&pguid={???}

Use TFS as a Helpdesk system

There is build-in solution to convert TFS to a HelpDesk system:
http://blogs.msdn.com/b/serkani/archive/2009/12/31/how-to-enable-work-item-only-view-in-team-web-access-2010.aspx
http://www.diaryofaninja.com/blog/2010/07/14/quick-and-easy-setup-for-ldquowork-item-only-viewrdquo-web-users-in-tfs-2010

Use TFS as a HelpDesk system

25 SharePoint External List Limitations

http://msdn.microsoft.com/en-us/library/gg334768.aspx
http://www.sharepointdiary.com/2012/03/limitations-of-external-lists-in.html
http://maiomardesouki.com/2012/08/05/bcs-external-list-limitations/

Workarounds for some of them already exist and for others can be implemented with code:

Export to Excel option is not available Export SharePoint 2010 External List to Excel https://exportexternallist.codeplex.com/
No Item Level Permissions SharePoint Column & View Permission
http://spcolumnpermission.codeplex.com/
Workflows cannot be configured for External Lists Instead of creating external list we can create regular list and add there external columns. Thus we can link workflows to it (of course, without reacting to external events).
Events handlers are not supported Can be implemented with a help of TFS server side plugins
http://blog.hinshelwood.com/tfs-event-handler-for-team-foundation-server-2010/

SharePoint/CRM Integration

http://msdn.microsoft.com/en-us/library/gg334768.aspx
As described in the upper link, SharePoint integration with Microsoft Dynamics CRM enables you to:

  • Create, upload, view, and delete documents on a server that is running SharePoint from within Microsoft Dynamics CRM.
  • Use the SharePoint document management abilities within Microsoft Dynamics CRM, such as checking the document in and out, viewing version history, and changing document properties.

Manually load assembly to BDCM

http://blog.repsaj.nl/index.php/2012/04/sp2010-assembly-was-requested-for-lobsystem-with-name-but-this-assembly-was-not-returned/

$url = "http://www.contoso.com"
$assemblyPath = "C:\lobsystem.dll"
$lobSystem = "TFSWITConnector"

Write-Host "Adding assembly to LOBSystem"
$serviceContext = Get-SPServiceContext $url
$lobSystem = Get-SPBusinessDataCatalogMetadataObject -ServiceContext $serviceContext -BdcObjectType lobsystem -Name $lobSystem
Import-SPBusinessDataCatalogDotNetAssembly -LobSystem $lobSystem -Path $assemblyPath

Last edited May 24, 2013 at 8:40 AM by MarkBabayev, version 10