Skip to content

Instantly share code, notes, and snippets.

@weirdpattern
Last active July 19, 2018 20:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weirdpattern/ffd0888ec3067dbde6d49fc0ee05a885 to your computer and use it in GitHub Desktop.
Save weirdpattern/ffd0888ec3067dbde6d49fc0ee05a885 to your computer and use it in GitHub Desktop.
.2018.06.25.customize-tfs-process-model
2018.06.25.customize-tfs-process-model
$env:Path += "$env:Path;${env:ProgramFiles(x86)}\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer"
...
<WORKFLOW>
...
<STATE value="Waiting Verification">
<!-- Updates the value of the Activity field to Testing -->
<FIELD refname="Microsoft.VSTS.Common.Activity">
<COPY from="value" value="Testing">
</FIELD>
</STATE>
...
<TRANSITIONS>
<TRANSITION from="In Progress" to="Waiting Verification">
<REASONS>
<DEFAULTREASON value="Development finished" />
</REASONS>
</TRANSITION>
<TRANSITION from="Waiting Verification" to="In Progress">
<REASONS>
<DEFAULTREASON value="Needs fixing" />
</REASONS>
</TRANSITION>
<TRANSITION from="Waiting Verification" to="Done">
<REASONS>
<DEFAULTREASON value="Reviewed" />
</REASONS>
</TRANSITION>
</TRANSITIONS>
</WORKFLOW>
...
$env:Path += "$env:Path;${env:ProgramFiles(x86)}\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer"
witadmin importwitd /collection:"<your_collection>" /p:"<your_project>" /f:"<you_local_path_to_file>"
witadmin exportwitd /collection:"<your_collection>" /p:"<your_project>" /n:"<type_definition>" /f:"<you_local_path_to_file>"
<Witd:WITD>
<!-- Identifies the work item -->
<WORKITEMTYPE>
<!-- Describes the work item -->
<DESCRIPTION></DESCRIPTION>
<!-- Defines the work item fields -->
<FIELDS></FIELDS>
<!-- Defines the workflows followed by the work item -->
<WORKFLOW></WORKFLOW>
<!-- Defines the UI of the work item -->
<FORM></FORM>
</WORKITEMTYPE>
</Witd:WITD>
...
<FIELDS>
<FIELD name="Priority" refname="Microsoft.VSTS.Common.Priority" type="Integer" reportable="dimension">
<HELPTEXT>Importance to business</HELPTEXT>
</FIELD>
</FIELDS>
...
...
<FIELDS>
<FIELD name="Title" refname="System.Title" type="String" reportable="dimension">
<REQUIRED />
</FIELD>
</FIELDS>
...
...
<FIELDS>
<FIELD name="Closed Date" refname="Microsoft.VSTS.Common.ClosedDate" type="DateTime" reportable="dimension">
<REQUIRED />
</FIELD>
</FIELDS>
...
...
<FIELDS>
<FIELD name="State Change Date" refname="Microsoft.VSTS.Common.StateChangeDate" type="DateTime">
<!-- Set the current time when State changes -->
<WHENCHANGED field="System.State">
<SERVERDEFAULT from="clock" />
</WHENCHANGED>
<!-- Make the field readonly if State hasn't changed from the original value -->
<WHENNOTCHANGED field="System.State">
<READONLY />
</WHENNOTCHANGED>
</FIELD>
</FIELDS>
...
...
<STATE value="Done">
<FIELDS>
<!-- Clears the Remaining Work field when the state is Done -->
<FIELD refname="Microsoft.VSTS.Scheduling.RemainingWork">
<EMPTY />
</FIELD>
<!-- Marks Closed Date as required and sets the value to the current date/time -->
<FIELD refname="Microsoft.VSTS.Common.ClosedDate">
<REQUIRED />
<SERVERDEFAULT from="clock" />
</FIELD>
</FIELDS>
</STATE>
...
...
<TRANSITION from="" value="New">
<REASONS>
<REASON value="Build Failure">
<DEFAULTREASON value="New defect reported" />
</REASONS>
</STATE>
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment