Tuesday, April 24, 2012

TFS 2010 – Work Item Link Types

What and Why we need work Item Link Types

By creating relationships between work items and other resources, you can plan projects more effectively, track dependencies more accurately, view hierarchical relationships more clearly, and find relevant information more quickly. For example, you can create a relationship between two work items to show that one of the items must be completed first. In addition, you can create a relationship between a work item and a changeset to show how the code was changed to address a feature request.

When you create relationships between work items, you select the type of link that best supports your project planning and tracking efforts. Different types of links support different capabilities and are based on one of four topologies as described below.

  • Use a Related Link to Make Non-Hierarchical Relationships
  • Use Parent-Child Links to View Multi-Tiered, Hierarchical Relationships
  • Use Predecessor-Successor Links to Plan and Track Project Tasks and their Dependencies
  • Use Dependent Links to View and Track Dependent Work Items
  • Use Changeset and Versioned Item Links to Associate Tasks and Features with Development Work and Version Items

Topologies

Network: You can use network links to create basic relationships between work items that are non-restrictive. The link is the same at both end points. Circular relationships are allowed.

Example usage: Use a network link, such as Related, to record a relationship between two features that might share dependencies.

Topology of Network Links

Directed Network: You can use directed network links to create relationships between work items that indicate directionality. The link name is different at the end points. Circular relationships are allowed.

Example usage: Use a directed network link to record a relationship between two features that might share dependencies and which you want to distinguish from each other in some way.

Topology of Directed Network Links

Dependency: You can use dependency links to create relationships between work items that have directionality and to restrict circular relationships. The link name is different at the end points.

In the illustration, you cannot create a dependent link to a work item that contains dependent link relationships to the same work items.

Example usage: Use a dependency link to record the features that must be completed to deliver a user requirement.

Topology of Dependency Links

Tree: You can use tree links to create multi-level hierarchical relationships among work items. Tree links support multi-level hierarchical views, have directionality, and restrict circular relationships. The link name is different at the end points. Tree links are the only type of link that is supported by the Tree of Work Items query.

In the illustration, you cannot assign two parents to a child.

Example usage: Use a tree link to record tasks and subtasks from your team that must be completed to deliver a feature.

Topology of Tree Links

Here is the Parent-Child links and Dependency links detail, detail about other links are available at http://msdn.microsoft.com/en-us/library/dd286513.aspx

Parent-Child Links

You create parent-child links between work items in order to view multi-tiered, hierarchical relationships between the work items. This link type is most often used to break down user stories into features and to divide tasks into subtasks. Parent-child links are based on the tree topology, support a one-to-many relationship set, and prohibit circular definitions, that is, a child node can only have one parent.

Benefits:

Restrictions and recommendations:

  • A work item can have only one parent, although a parent work item can have many children.

  • Work items joined by parent-child links must be defined for the same team project. This action is recommended if you plan to use Office Excel or Office Project to modify or update work item data.

    Note Note

    You can create parent-child links between work items that are defined in different projects. However, if you export a query to Office Excel or Office Project, only those work items that are defined for the team project for which the query is defined are imported into the Office client.

Dependent Links

You create links to work items by using a dependent link type in order to track work items that impact the ability to complete a requirement, feature, or task. Also, you can create links to work items that cross project boundaries.

Dependent links are based on a dependency topology, support one-to-many relationships, and prohibit circular definitions. You can perform any of the following tasks by using dependent links:

Benefits:

  • Find and view top-level work items and their dependent work items in a two-tiered view. For more information, see View and Modify Work Items in a Direct Links View.

  • Manage risks and dependencies and collaborate more effectively across project teams. For example, you can reach the following goals by defining dependent links between work items in your team project and those defined in another team project:

    • Create a dependent relationship to a feature or set of tasks that are under development by another team.

    • Request that another team accept a work item dependency.

    • Manage your commitments and cross-group dependencies to other teams.

Restrictions and recommendations:

  • Use dependent links when work items share dependencies. For example, use them when a user story has many features and some of the features fulfill two or more user stories.

  • Use dependent links rather than other link types to associate work items that are defined in another team project.

  • You cannot view hierarchical relationships created with dependent link types using Office Excel or Office Project except for those instances noted earlier in this topic for parent-child links and predecessor-successor links. 

Available Link Types in TFS 2010

Here are the available link types in TFS 2010.

System Defined Link Types

Forward Name

Reverse Name

Link type reference name

Topology

Successor

Predecessor

System.LinkTypes.Dependency

Dependency

Child

Parent

System.LinkTypes.Hierarchy

Tree

Related

Related

System.LinkTypes.Related

Network

MSF Process Template – Link Types

Forward Name

Reverse Name

Link type reference name

Topology

Tested By

Tests

Microsoft.VSTS.Common.TestedBy

Dependency

Test Case

Shared Steps

Microsoft.VSTS.TestCase.SharedStepReferencedBy

Dependency

Links and Resources

Add a Link Type: http://msdn.microsoft.com/en-us/library/dd469516.aspx

Defining Link Controls to Restrict Link Relationships: http://msdn.microsoft.com/en-us/library/dd638522(VS.100).aspx

Thursday, April 12, 2012

TFS Portal Error: This site doesn't have a default Team Foundation Server instance

Basically this error happens when SharePoint is NOT linked/connected with TFS. You can reconfigure this for the Team project where the portal is supposed to be connected.

Here are the steps.

First verify the TFS Collection has default SharePoint site.

Step 1: On Team Foundation Server Administration Console, Select the TFS Collection and “SharePoint Site” tab.

image

Step 2: Click “Edit Default Site Location” link and update the default site location.

image

Step 3: Access the SharePoint, if that did not fix the issue, reconfigure the portal setting for the team projects using Visual Studio

Reconfigure Team Portal Settings

Step 4: On the Visual Studio Team Explorer, right click on the Team Project and select “Portal Settings”

image

Step 5: Project Portal Settings page appears. Click on “Enable Team Project Portal” and Click on “Configure Url” button.

image

Step 6: On “Specify an existing SharePoint Site” window (as mentioned in image above), specify the SharePoint URL. Confirm the url by clicking on the URL link. Now the SharePoint would show the data from reports and other details

Step 7: Press OK to save the changes.

Start/Stop Visual Studio Team Build Service using API

Here is full code snippet to start/stop Visual Studio Team Build Service.

private const string TFSBuildService = "TFSBuildServiceHost";
private ServiceController TFSController;

public TeamBuildServiceController()
{
// Check if the Visual Studio Team Build service exists on the machine. If not then raise an error.
bool srvcExists = false;
foreach (ServiceController srvcOnMachine in ServiceController.GetServices())
{

if (string.Compare(srvcOnMachine.ServiceName, TFSBuildService, StringComparison.OrdinalIgnoreCase) == 0)
{
srvcExists = true;
break;
}
}


this.TFSController = new ServiceController {ServiceName = TFSBuildService};
}

public void StopService()
{
if(this.TFSController == null)
{
return;
}

// Stop the service if its running
if (this.TFSController.CanStop)
{
this.TFSController.Stop();
int timecounter = 0;

while (this.TFSController.Status != ServiceControllerStatus.Stopped)
{
if (timecounter > 60)
{
break;
}

timecounter++;
Thread.Sleep(1000);
this.TFSController.Refresh();
}
}

if(this.TFSController.Status != ServiceControllerStatus.Stopped)
{
Thread thread = new Thread(ShowMessageToRestart);
thread.SetApartmentState(ApartmentState.STA);
thread.Start(
"The Visual Studio Team Foundation Build service cannot be stopped. Changes to the environment variable will not reflect on the builds till the service has been restarted. \r\n\r\nPlease restart the service after the installation completes.");
thread.Join();
}
}

public void StartService()
{
if (this.TFSController == null)
{
return;
}

// Start TFS build service
this.TFSController.Start();
int timecounter = 0;

while (this.TFSController.Status != ServiceControllerStatus.Running)
{
if (timecounter > 60)
{
break;
}

timecounter++;
Thread.Sleep(1000);
this.TFSController.Refresh();
}

if (this.TFSController.Status != ServiceControllerStatus.Running)
{
Thread thread = new Thread(ShowMessageToRestart);
thread.SetApartmentState(ApartmentState.STA);
thread.Start(
"The Visual Studio Team Foundation Build service cannot be started. Team build will not be executed on this machine until the service is not started. Please try to start the service manually.");
thread.Join();
}
}




Wednesday, April 11, 2012

Creating TFS Alerts using Eclipse TEE

TFS Alerts are very useful to know about the work item updates,CI build statuses and check-in. There are some basic alerts available in TFS out of box and custom alerts in Power Tools. The alerts can be created using TFS Web Access and/or Visual Studio, but there were none using Eclipse.

Finally the Power Tools (Alert Editor) is available for Eclipse. Here are the steps to create alerts using Eclipse/TEE

Prerequisites

1. Eclipse 3.2-3.7

2. Microsoft Visual Studio Team Explorer Everywhere 2010 (TEE) with SP1

http://www.microsoft.com/download/en/details.aspx?id=25125

Step 1: Download and Install

The Team Foundation Server 2010 Powers Tools for Eclipse is available here. The setup instructions are available on the same page.

http://www.microsoft.com/download/en/details.aspx?id=28557

Step 2: Open Alerts Explorer on Eclipse

image

Step 3: The Alert Explorer would show all the alerts created by you. To create new alerts click on “New Alert”

image

image

Pick an alert template, example choose “Failed Builds” to send alert when a build fails.

Step 3: Update the Send to email address or pick the emailids by using the “Select Users” button.

image

Step 5: You can change the name of the Alerts, and add filters by adding fields and values.

image

Step 6:  You can save the alerts by clicking the save button. Now you have successfully setup a custom alert.

image

Tuesday, April 10, 2012

Business Intelligence Development Studio Downloads

To develop reports we need BIDS (Business Intelligence Development Studio). It is free and available as part of SQL Server Express editions. The BIDS is available for SQL Server 2005 and SQL Server 2008.

Here is more detail about BIDS

http://msdn.microsoft.com/en-us/library/ms173767.aspx#Accessibility

Microsoft SQL Server 2005 Express Edition Toolkit

http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=19413

Microsoft® SQL Server® 2008 Express with Tools

http://www.microsoft.com/en-us/download/details.aspx?id=1842

TFS Portal Error: This site doesn't have a default Team Foundation Server instance

Basically this error happens when SharePoint is NOT linked/connected with TFS. You can reconfigure this for the Team project where the portal is supposed to be connected.

Here are the steps.

First verify the TFS Collection has default SharePoint site.

Step 1: On Team Foundation Server Administration Console, Select the TFS Collection and “SharePoint Site” tab.

image

Step 2: Click “Edit Default Site Location” link and update the default site location.

image

Step 3: Access the SharePoint, if that did not fix the issue, reconfigure the portal setting for the team projects using Visual Studio

Reconfigure Team Portal Settings

Step 4: On the Visual Studio Team Explorer, right click on the Team Project and select “Portal Settings”

image

Step 5: Project Portal Settings page appears. Click on “Enable Team Project Portal” and Click on “Configure Url” button.

image

Step 6: On “Specify an existing SharePoint Site” window (as mentioned in image above), specify the SharePoint URL. Confirm the url by clicking on the URL link. Now the SharePoint would show the data from reports and other details

Step 7: Press OK to save the changes.