Showing posts with label WorkItemCustomization. Show all posts
Showing posts with label WorkItemCustomization. Show all posts

Monday, June 27, 2016

TFS Work Item Customization using TFS Power Tool: Part 5

How to restrict the user or group from creating or updating a specific work item type.

 

Hi All,

In this post we will see how to stop a user or group from creating or updating a particular work item type in TFS team project.

In TFS team project we can either give read/write permission to all work item type or none of them, but it is not possible to restrict the user or group from creating or editing a specific work item type like bug or task.

In this post I’m going to provide a work around to achieve the requirement- where a user or group should be able to create or update all work item types except Bug, let us see how to do this.

    1.      Open bug work item template using process tab.

    Open Visual Studio, and Click on TOOLS -> Process Editor-> Work Item Types-> Open WIT from server, to open the template online.

       

      https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6aY-PWA-6JDK8_dsu3Viqlf38S9hPbzKwwxtS1yczhd0mVud780Xf_yZPiqAHP-YZdbOUSwRxbYK1dPm4c7lCSzE8AfCwKUB6gVVD_TWenuifbDAnvXCz-khxenP3jbXoIXCZnD3mGXoB/s1600/OpenTaskOnline.png

      2.      Now connect to the TFS and then to the Team Project under the Team Project Collection. Select work item type Bug.

       

      3.      Look for field Changed by and double click on it to edit.

       

      4.      When Field Definition window opens, click on Rules tab to add a new rule READONLY by clicking New button.

      5.      In the Select a rule type window select rule named READONLY, then click OK.

      6.      Now time to use this rule to achieve our requirement, identify the group to which this bug work item type should not be editable. Here in my example I want make bug work item type non editable for members of the Team Project Default group Contributors.

      Pass the value [project]\Contributors in the field For, find below screenshot for your reference.

      Then click OK.

      7.      Now you will see the new rule added to the list. Click OK. Then Save changes to server by clicking Save button of Visual Studio or using key board shortcut , Ctrl+s

       

      8.      Now connect to Team Project then open Team Project Administer Sever Page by clicking on  Administer Server gear button.

       

      9.      In Team Project Administer Sever Page open Security Tab. Under Security Tab look for group Contributors and add a windows user by clicking Add button under Members tab.

       

       

      Search for the member. Then click on Save changes button.

       

      Now a new member (Brian Keller) is added to the group Contributors.

      10.   Now login as one contributor member and connect to Team Project, here it is Awesome Team Project.

      11.   Click on Create new, dropdown list and select Bug work item type.

      12.   Enter the details and then click on Save button.

      13.   On Clicking save this user will be prompted with message as shown in below screenshot. By this way can restrict user from creating and updating Bug work item type.

       

      Hope you enjoyed this blog.

      Happy blogging J

       

Saturday, April 2, 2016

TFS Work Item Customization using TFS Power Tool: Part 3



Customize “Assigned To” field to list users only from the team project.



Hi All,
In this post I will show you how we can customize “Assigned To” field of task work item to list members only from Team Project.
By default TFS work item “Assigned To” field displays all the users from Team Project Collection. Most of our customer came with the request that they want to list only the users from their team project so that it will be easy to select the users to assign any work item to them, here is the steps to achieve the same.
In this blog I am going to show how edit work item online/in the server, without exporting and modifying offline and importing back to TFS.
Open Visual Studio, and Click on TOOLS -> Process Editor-> Work Item Types-> Open WIT from server, to open the template online.



Now connect to the TFS and then to the Team Project under the Team Project Collection.  Here collection is Awesome Collection.

 Select work item type Task (can be any other work item type)


In the fields tab, double click on “Assigned To” field.



In the Field Definition window click on Rules tab. Here we can see that already there are two rules defined, ALLOWEXISITINGVAUE and VALIDUSER.



Since we want to list users only from the team project, I suggest you to make use of the team project group called “Project Valid Users”, since all users who are members of the team project will automatically become member of “Project Valid Users” group.
Now click on New and select rule named, ALLOWEDVALUES then click OK.

In the next window we can add new list by clicking New.

In the text box enter the value [project]\Project Valid Users then click OK.


Check the option Exclude Groups to eliminate groups from the list. This will exclude TFS groups from listing in the drop down. Then click OK.


Click OK again.


Now our template is ready to be saved. Save the changes by clicking on “Save” button or ctrl+S. Since we are editing template online, the changes are saved directly to TFS Server, changes will reflect in your Visual Studio/Team Explorer task work items after you Refresh the connection.
Thanks for reading this blog. Hope you enjoyed.

TFS Work Item Customization using TFS Power Tool: Part 1

In this post I will explain how we can add a custom field for a work type of existing team project.
To customize work item template we can make use of TFS power tool or witadmin command prompt options.
In this post I will show case TFS work item customization using TFS power tool.

Adding custom field using TFS power tool.

We can download Microsoft Visual Studio Team Foundation Server 2013 Power Tools from here, same link will also provide all other feature details of power tool.
When we use power tool to customize the work item template, we can do customization directly on server or we can export the template to local machine and import it to team project after customization.
To Export the template from the team project to local machine follow below steps.
Open Visual Studio 2013.
Click on TOOLS -> Process Editor-> Work Item Types->Export WIT


Connect to the Team Project collection. Here collection name is Awesome Collection.


Then select the Task Work Item Type from the Team Project of which work item template has to be customized the Click OK

Save the template in local machine.


When Asks for the pop up with message “Would you like in include the Global List definition?” Click on No button.

Below pop up window will appear on successful export of the template.


Now we can open the template in Visual Studio using power tool. Click on TOOLS -> Process Editor-> Work Item Types->Open WIT from File 


This is how template will look in Visual Studio when power tool is installed. This is called template editor and we will see the Name and Description of the template also 3 tabs named Fields, Layout and Workflow.

In Fields tab we can create or define new work item field with different rules or validations. Once we define field, we can make this field appeared in the work item UI using Layout tab, where we can also preview the work item template and decide where to place the field in the template UI. Workflow tab is used to define the states and transition for the work item and we can also add some the rules to the fields based on the stated of the work item, for example let us say all fields in the temple should be non-editable when state of the work item is Closed.


Let us create two fields named Tech Decision and Management Decision with both containing drop down values Approved, On-Hold, Rejected so that user can select value in the work item UI.

Click on New on the template editor



Fill in the data as below
Name: Tech Decision
Type: String
Reference Name: YourCompanyName.Common.TecDecision
Help Text: Technical Decision Approved, On-Hold or Rejected
Reportable: Dimension
Note: Reference name must contain minimum one period(.) and must not begin or end with period(.)

To add the list of values click on Rules then New


To add the list of values we can make of the rule ALLOWED VALUES and then Click OK


Below window will popup


Click on New.  And type Approved in the List Item box. Then click ok.



Again click on New to add one more list item Rejected.


And type Rejected in the List Item box. Then click ok. Follow above step to add one more list item On-Hold.

Click OK then OK.
Follow same steps as Tech Decision to and new field Management Decision with values Approved, On-Hold and then Rejected.



Now we can see the new fields in fields list of template.


By completing above steps we are just created the new fields Tech Decision and Management Decision with list values. Now let us see how to put these fields in the work item UI so that user can select the values. To edit the UI of the template we will make use of Layout tab.

Click on Layout tab.


Right Click on the Column just above the Group Status, then click on the New Group option to create new group named Decision.


Select the new group and at the right side provide Label value as Decision


When we create a group a default column will be added below, right click on the column to add the control

Enter below values for the attribute of the control and rest attributes we can leave as it is.
Label: Tech Decision
Field Name: YourCompanyName.Common.TechDecision


Again right click on the same colum and add new control give below details
Label: Management Decision
Field Name: YourCompanyName.Common.ManagementDecision


Now save the changes and template is ready to import. We ca also have preview of template before importing it to server. To have preview click on Preview Form button.



To import work item to server, go to TOOLS -> Process Editor-> Work Item Types->Import WIT

 Now browse for the Task.xml template and also select team project to which template has to be imported, click OK.


Open Team Explorer, click on Refresh button and then create new Task item from work items tile. And you should able to view Decision group with fields Tech Decision and Management Decision.