DCSIMG
September 2009 - Posts - Eran Ruso
Sign in | Join | Help

September 2009 - Posts

Team System Work Items Basic User Guide – Create New Work Items Out Of An Existing Work Items

פורסם בתאריך Sep 30 2009, 11:15 AM על ידי Eran Ruso

This post is the forth post out of Five that builds the Work Items Basic Guide. See the first post: “Team System Work items Basic User Guide – Introduction” 

I have already published the “Team System Work Items Basic User Guide – Create New Work Items” and the “Team System Work Items Basic User Guide – Create And Use Queries”

We have seen in previous posts how to create a new work item and how to create and manage my queries, on this post we will see how to create a new Work Item out of an existing Work Item.

In order to create a copy of a Work Item do the following:

Step 1: Right click any of the gray parts in the source Work Item, choose "Create Copy of Work Item…" option.

image

Step 2: Choose the target Team Project and the Work Item Type.

image

What you will now have is a copy of the source Work Item, in case you will choose to create a different Work Item Type from the source Work Item Type only the sheared fields will be filled.

In the Links tab of the new Work Item you will see a link to the source Work Item.

When saving your new Work Item you will get cross links, there will be a link from the source Work Item to the new Work Item and vice versa.

image

image

Many times you will need to create Work Items that are similar, using the copy Work Item option saves a lot of Copy/Pastes and time.

TFS API: Get Project Members

פורסם בתאריך Sep 13 2009, 03:22 PM על ידי Eran Ruso

I have been asked to write a few times custom controls that requires me to get the users from the Team Project.

The method that does that is very simple, the example in this post takes the members from the project by the “project name” that was passed to it, and adds them to a combobox named cmbUsers.

using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.Proxy;
using Microsoft.TeamFoundation.Server;

 

 

 

public void GetUsers(TeamFoundationServer server, string project)

 

    {
      cmbUsers.Items.Clear();

 

      IGroupSecurityService securityService = 
             
(IGroupSecurityService)server.GetService
                 (typeof(IGroupSecurityService));

 

      Identity[] projectGroups =
               securityService.ListApplicationGroups
                 (store.Projects[project].Uri.AbsoluteUri);

 

      foreach (Identity projectGroup in projectGroups)
 
    {

 

 

        Identity[] groupMembers =
               securityService.ReadIdentities
                  (SearchFactor.Sid, new string[]
                    { projectGroup.Sid },
                         QueryMembership
.Expanded);

 

 

        foreach (Identity member in groupMembers)
        {

 

          if (member.Members != null)
          {

 

 

            foreach (string memberSid in member.Members)
            {

 

 

              Identity memberInfo=
                  securityService.ReadIdentity
                     (SearchFactor.Sid, memberSid,
                         QueryMembership
.None);

 

             cmbUsers.Items.Add(memberInfo.DisplayName);

 

            }

 

 

          }

 

 

        }

      }

 

 

    }

Have Fun!!!

Delete TFS Work Item Types

פורסם בתאריך Sep 10 2009, 10:52 AM על ידי Eran Ruso

I have already written about How To Delete Work Items in TFS in this post I like to show how you delete Work Item Types you don’t need so you will not get a long list of Work Item Types when creating new Work Items.

Here is how to do it:

Step 1: Download and Install the Team Explorer 2008 - October Power Tools.

Step 2: Log-in to the TFS using a TFS administrator user.

Step 3: Open a command line and go to: “X:\Program Files\Microsoft Team Foundation Server 2008 Power Tools”

Step 4: Use the “TFPT.EXE destroywitd” command in the following way:

tfpt.exe destroywitd /server:[ServerName] /project:[Project Name] /workitemtype:[WI Type]

Important to know that all the Work Items created using this Work Item Type will be lost too.

You can disable the prompt message by using /noprompt.

Have Fun!!!

Team System Work Items Basic User Guide – Create And Use Queries

פורסם בתאריך Sep 03 2009, 04:56 PM על ידי Eran Ruso

This post is the third post out of Five that builds the Work Items Basic Guide. See the first post: “Team System Work items Basic User Guide – Introduction” 

I have already published the “Team System Work Items Basic User Guide – Create New Work Items”

On this post I will talk about Queries.

In order to see the Work Items you have entered to the Team System you will need to create a "Search", the way you search the Team System is by Queries.

Queries contains filters, you can put filters on each of the Work Item fields.

There Are two groups of queries:

  • Team Queries – These queries are available to the entire group and are created and modified by the Project Administrator.
  • My Queries – These are personal queries that will be available to me only and are created and modified by the user.

image

In order to create a query do the following:

Step 1: Right Click the "Work Item" folder in the Team Explorer and choose "Add Query"

image

There are two sections in the Query editor window:

1. Filters Section – where you can add filters to your query, filters can be added to every field exist in you work item type.

2. Results Section – Where you will see the results of the query you build.

image

Step 2: Add filters to the query, in case you like to see all the Work Items that are in the system don't add any filters just run the query with the default Team Project filter.

For this example I have added the "Work Item Type" filter, I have set it to be "Task".

Note: The default filter just set the Team Project contexts of the query, @Project means the project I am in now.

image

image

Step 3: When you have finished setting the filters run the query to see if you get the results you need, click the "Run" button from the menu.

image

image

You get a list of work items that answers the filters you have just set.

Step 4: By default you get the ID and the Title columns in the results window, in order to change that right click one of the columns and choose: "Column Options…".

image

Step 5: From the left hand side choose each of the fields you like to see in the results window and pass them to the right hand side of the window, you can also choose their locations by using the arrow buttons located next to the left hand side of the window and you can also control their default width by changing the value in the text box under the arrow buttons.

image

I have chosen to see the "Work Item Type" in this example the result is the "Work Item Type" column.

image

Step 6: When ready save the query by clicking the "Save" button.

image

The save window gives 3 save options:

  1. Save to Team Queries – Only administrator can use this option.
  2. Save to My Queries – Default and most used option, saves the query so it will be available to me only.
  3. Save to File – When you will like to pass a query to other team members you can use this option to export a query.

image

In this example I have saved the query to My Queries section.

image

Now that you have a saved query you can do three things:

  1. Run the query – Double click the query.
  2. Delete the query – Right click the query and choose "Delete".
  3. Edit the query Follow these steps:

Step 1: Right click the query and choose "View Query".

image

Step 2: Make changes.

image

Step 3: Save changes

image

As you can see, managing queries is very simple and intuitive.

Now that you know how to create and manage queries you can get to the information stored in the Team System in an easy and comfortable way.

Have Fun!!!