Here is how I added [AHA Reference] column (custom column) to my local TFS, which I learned from
https://learn.microsoft.com/en-us/vsts/work/customize/reference/witadmin/witadmin-import-export-manage-wits?view=tfs-2018
1) run below command to export the WIT
witadmin exportwitd /collection:http://XXXXX:8080/tfs/DefaultCollection /p:LocalTestProject /f:c:\temp\myworkitems_local.xml /n:Feature
2) In the generated xml file, I added this to the FIELDS node
3) then I added a Control node under FORM
4) then in the TFS, I added [AHA Reference] column, and I can see it in the list.
5) Since I added control in step 3, my understanding is that in the detail popup, it should show the [AHA Reference] under ‘value area’. It never showed up. But, the [AHA Reference] field is added and I can retrieve it from code.
Maybe my understanding is not correct. Not an important question. I’m just curious what that ‘Control’ node in WIT does if not adding the ‘control’ to UI.
Thanks
It's because you added the Control under the old form/team explorer in step 3. If you back to old form, you'll see this field. In order to make the Control shows in new web form, you need to add the control under <FORM><WebLayout>...</WebLayout></FORM>:
<FORM>
<WebLayout>
<Page Label="Details" LayoutMode="FirstColumnWide">
<Section>
<Group Label="Details">
<Control Label="Priority" Type="FieldControl" FieldName="Microsoft.VSTS.Common.Priority" />
<Control Label="Effort" Type="FieldControl" FieldName="Microsoft.VSTS.Scheduling.Effort" />
<Control Label="Business Value" Type="FieldControl" FieldName="Microsoft.VSTS.Common.BusinessValue" />
<Control Label="Time Criticality" Type="FieldControl" FieldName="Microsoft.VSTS.Common.TimeCriticality" />
<Control Label="Value area" Type="FieldControl" FieldName="Microsoft.VSTS.Common.ValueArea" />
<Control Label="AHA Reference" Type="FieldControl" FieldName="AHAReference.AHAReference" />
</Group>
</Section>
</Page>
</WebLayout>
</FORM>
Useful links:
https://learn.microsoft.com/en-us/vsts/work/customize/customize-wit-form?view=vsts
https://learn.microsoft.com/en-us/vsts/work/customize/reference/weblayout-xml-elements?view=vsts
Related
I administrate an on-premises TFS server currently on TFS 2018.3.
I need to learn how to add a new column to the Kanban iteration board (which is where tasks are shown).
I searched and searched and found this post that is exactly relevant to this question, but the answer appears to only related to a different version of TFS (probably Azure DevOps 2019).
Nevertheless, I am able to download a copy of the Process (Agile), unzip and modify the tasks to show a new state. (I have incidentally also modified the witadmin (exportwitd) Tasks.xml and modified the workflow section to reflect the new state and state transitions.)
As a result, I can upload my new process template (after changing the name and guid), and create a new project based on it. When I create a story and sub-task, the new state and transitions behave as expected. However, no new column appears on my iteration board. If I transition the task to the new state, it simply disappears from the board.
I can alter columns for "User Stories", and create swimlanes and such with no issues. However, navigating to the Settings (Gear Icon) for the iteration does not give the "columns" setup that it does for User Stories.
Nevertheless, there must be a way to do it, because I can see that in my same collection, my new test project shows the columns "New", "Active", "Resolved", and "Closed", while other previously existing projects show only "Active" and "Closed", so there must be a means of configuring this on a project by project basis as the post suggests.
Can anyone describe for me how to add columns to the kanban iteration board?
You need to export the process config file and add there the new state (and of course, add it to the work item XML states (e.g. Tasks.xml)).
Export the file:
witadmin exportprocessconfig /collection:CollectionURL /p:ProjectName [/f:FileName] [/e:encoding]
There in the task category add the new state (under the <States>):
<TaskBacklog category="Microsoft.TaskCategory" parent="Microsoft.StoryCategory" pluralName="SubTasks" singularName="SubTask" workItemCountLimit="500">
<AddPanel>
<Fields>
<Field refname="System.Title" />
</Fields>
</AddPanel>
<Columns>
<Column width="400" refname="System.Title" />
<Column width="100" refname="System.State" />
<Column width="100" refname="System.AssignedTo" />
<Column width="50" refname="Microsoft.VSTS.Scheduling.RemainingWork" />
</Columns>
<States>
<State type="Proposed" value="Active" />
<State type="Proposed" value="NEW-STATE" />
<State type="InProgress" value="In Progress" />
<State type="Complete" value="Done" />
</States>
Then import:
witadmin importprocessconfig /collection:CollectionURL [/p:ProjectName] /f:FileName [/e:encoding] [/v]
While importing a newly customized Work Item Type Definition into TFS 2017.3, I am receiving the error:
VS403073: Group {GroupName} violates the rule that a group can only
contain a single HTML or WebPage control preceded by label controls.
My question is three-fold:
1) Where are these styling/schema rules documented? I was unable to find any information on this, or any other schema rule, on Microsoft's site here.
2) I am trying to keep several FieldControls and a single HTMLFieldControl grouped together under one heading on the WebForm for organization purposes. Why would there be a rule put in place to prevent this type of organization?
3) Is it possible to, and what would be the consequences of, bypassing this rule and importing the WITD anyway?
Please let me know if any further information/clarification is needed.
Edit:
Psudo code would be something to this effect:
<WebLayout>
...
<Page>
<Section>
<Group Label="Group 1">
<Control type="FieldControl" Label="G1C1" FieldName="X.G1Field1" />
<Control type="FieldControl" Label="G1C2" FieldName="X.G1Field2" />
<Control type="FieldControl" Label="G1C3" FieldName="X.G1Field3" />
<Control type="HTMLFieldControl" Label="G1C4" FieldName="X.G1Field4" />
</Group>
</Section>
</Page>
</WebLayout>
I ran into this as well. I moved the HTMLFieldControl to its own group and that resolved the issue.
Example from Microsoft's documentation
Error:
<Section>
<Group Label="Description:">
<Control Label="Reason For Request:" Type="HtmlFieldControl" FieldName="System.Description" />
<Control Label="Business Case For Request:" Type="HtmlFieldControl" FieldName="MB.BusinessCase" />
</Group>
</Section>
Resolution:
<Section>
<Group Label="Reason for Request">
<Control Label="Reason For Request:" Type="HtmlFieldControl" FieldName="System.Description" />
</Group>
<Group Label="Business Case">
<Control Label="Business Case For Request" Type="HtmlFieldControl" FieldName="Custom.BusinessCase" />
</Group>
</Section>
Documentation can be found HERE
Noticed StateChanged field is missing within XML definitions of some work items in scrum template of tfs 2017 RTM : pbi, testplan, testsuite, feebackrequest, codereviewrequest, and some more.
I assume i should add it manually to them. Right ?
If you mean the State Change Date field, yes, by default it's not added in some work items in scrum template.
Actually the control is not added to layout eventhough in the existing work items such as Bug, Feature. That means, you cannot see the field in work item layout. However you can add the control to display the field based on your requirements.
Yes, you can also add the State Change Date field manually to the work items which not exsiting in them. See Add a field, or apply a rule, or change an attribute for details.
You can also use the TFS Process Template Editor to edit the WITs definitions.
Field:
<FieldDefinition name="State Change Date" refname="Microsoft.VSTS.Common.StateChangeDate" type="DateTime">
<WHENCHANGED field="System.State">
<SERVERDEFAULT from="clock" />
</WHENCHANGED>
<WHENNOTCHANGED field="System.State">
<READONLY />
</WHENNOTCHANGED>
</FieldDefinition>
Layout Control:
<Group Label="Status">
<Column PercentWidth="100">
<Control FieldName="Microsoft.VSTS.Common.StateChangeDate" Type="DateTimeControl" Label="State Change Date:" LabelPosition="Left" />
</Column>
</Group>
Page Section:
<Section>
<Group Label="Status">
<Control Label="State Change Date:" Type="DateTimeControl" FieldName="Microsoft.VSTS.Common.StateChangeDate" />
</Group>
</Section>
In TFS 2010 a requirement work item had also an implementation and a change request tab.
In TFS 2012 the requirement work item also had an implementation and change request tab as written in the documentation, but the picture of a newly created requirement doesn't show anymore these tabs.
Now, in TFS 2015 those two tabse aren't mentioned any more, though the CMMI process shows the work item hierachy as
Epic > Feature > Requirement > Task
I am missing the implementation and change request tab in the standard configuration the CMMI project, because they are very useful in tracking the whole work from defining the features down to the requirements and their implementation with testing as well as subsequent change requests.
Are there any ways to get back these tabs in the standard configuration? I don't like to change the predefined work item types, because you never now what happens with next upgrades of TFS.
I had to go back all the way to 2010 to find the tab definitions you're missing. You can't "configure" TFS to show additional tabs without changing the process definition. To add them back in you have two options.
Create a custom template.
Patch the Requirement form definition after project creation.
The latter option should work well in combination with the way exiting process templates are "upgraded" using the Feature Activation Wizard, though with the new Work Item Form's and the new way Process template customization is done on Visual Studio Team Services, it would not surprise me when the next version of TFS will require manual intervention after upgrade.
1. Create a custom template
Download the CMMI process template from TFS using Visual Studio, update the process template definition (ProcessTemplate.xml) file and give it a new name and GUID:
Then go to the WorkItem Tracking\TypeDefinitions folder and edit the Requirement.xml. Add the two old tabs and link controls back in:
<Tab Label="Implementation">
<Control Type="LinksControl" Name="HierarchyForm" LabelPosition="Top">
<LinksControlOptions>
<WorkItemLinkFilters FilterType="include">
<Filter LinkType="System.LinkTypes.Hierarchy" />
</WorkItemLinkFilters>
<WorkItemTypeFilters FilterType="include">
<Filter WorkItemType="Requirement" />
<Filter WorkItemType="Task" />
</WorkItemTypeFilters>
<ExternalLinkFilters FilterType="excludeAll" />
<LinkColumns>
<LinkColumn RefName="System.ID" />
<LinkColumn RefName="System.WorkItemType" />
<LinkColumn RefName="System.Title" />
<LinkColumn RefName="System.AssignedTo" />
<LinkColumn RefName="System.State" />
<LinkColumn LinkAttribute="System.Links.Comment" />
</LinkColumns>
</LinksControlOptions>
</Control>
</Tab>
<Tab Label="Change Requests">
<Control Type="LinksControl" Name="ChangeRequestsForm" LabelPosition="Top">
<LinksControlOptions>
<WorkItemLinkFilters FilterType="include">
<Filter LinkType="Microsoft.VSTS.Common.Affects" FilterOn="reversename" />
</WorkItemLinkFilters>
<WorkItemTypeFilters FilterType="include">
<Filter WorkItemType="Change Request" />
</WorkItemTypeFilters>
<ExternalLinkFilters FilterType="excludeAll" />
<LinkColumns>
<LinkColumn RefName="System.ID" />
<LinkColumn RefName="System.WorkItemType" />
<LinkColumn RefName="System.Title" />
<LinkColumn RefName="System.AssignedTo" />
<LinkColumn RefName="System.State" />
<LinkColumn LinkAttribute="System.Links.Comment" />
</LinkColumns>
</LinksControlOptions>
</Control>
</Tab>
Upload the custom process template using Visual Studio and create your new Team Projects using that template.
2. Update existing Projects
Use witadmin to export the definition for the requirement work item type from an existing project:
witadmin exportwitd /collection https://server/tfs/DefaultCollection /p MyProject
/n Requirement /f Requirement.xml
Edit the XML file using your favorite text editor (I use Visual Studio Code) and add the above mentioned XML snippet back in. Now that you have a definition for Requirement with the right layout, you can push it to existing projects. First, validate your changes:
witadmin importwitd /collection https://server/tfs/DefaultCollection /v
/f Requirement.xml
If no errors are found, import the definition:
witadmin importwitd /collection https://server/tfs/DefaultCollection /p MyProject
/f Requirement.xml
I have a custom TFS form. In this form i need to add a check box as
Select test:
Test1
Test2
Test3
Test1, Test2 and Test3 should be check box controls and the user can select any number of check boxes. How can I achieve this in TFS? I installed a code plex project http://witcustomcontrols.codeplex.com/
But there is no documentation on how I can use the controls or samples.
The download file from http://witcustomcontrols.codeplex.com/ contains an installer for the Windows controls and a .zip file for the Web Access controls.
To install windows control:
Simply run the msi setup and restart Visual Studio.
Fields associated with multivalue control should have list of suggested values and each value enclosed in square brackets. For example:
<FIELD name="Triage" refname="Microsoft.VSTS.Common.Triage" type="String" reportable="dimension">
<HELPTEXT>Status of triaging the bug</HELPTEXT>
<SUGGESTEDVALUES expanditems="false">
<LISTITEM value="[Approved]" />
<LISTITEM value="[Investigate]" />
<LISTITEM value="[Rejected]" />
<LISTITEM value="[Submit]" />
</SUGGESTEDVALUES>
</FIELD>
Then use MultiValueControl as controltype for that field in Form section, for example:
<Control Type="MultiValueControl" FieldName="Microsoft.VSTS.Common.Triage" Label="Triag&e:" LabelPosition="Left" />
Check: http://witcustomcontrols.codeplex.com/wikipage?title=MultiValue%20Control
To install web control:
Navigate in your browser to the configuration panel for the web
extension of TFS: http://servername:8080/tfs/_admin/_extensions
Click on the Install and upload the CodePlex.WitCustomControls.MultiValueControl.zip-file, make
sure to use the .zip file matching you TFS server version.
Enable the extension.
Check: http://witcustomcontrols.codeplex.com/releases/view/616048
As of the recent release of TFS 2015 Update 2, this can be done with the witd in on-prem TFS like this (example is from a Bug).
Definition:
<FIELD name="CustomerReported" refname="X.X.CustomerReported" type="Boolean" reportable="dimension">
<DEFAULT from="value" value="True" />
</FIELD>
Layout:
<Control FieldName="X.X.CustomerReported" Type="FieldControl" Label="Customer Reported" LabelPosition="Left" />