VSTS Work item form control libraryThis extension is a library of several custom controls targeting work item form. A work item form in VSTS can be extended via extensions. Users can write their own custom controls, groups or pages that would show up in VSTS work item form in web. For reference, visit Extend the work item form. If you are using TFS, you can add these controls to work item form via work item type xml file - Add extensions in work item form via work item type definition xml. If you are using VSTS, you can add them from process admin page -Add or modify a custom control for a process and WIT. A work item form custom control can take some user inputs to configure the control. I'll describe what inputs are required for eah of the control below. This extension is an attempt to provide samples to other users to help them write their own extensions targeting work item form. There are 6 work item control contributions in this extension -
The code for this extension is on github DateTime ControlA custom date time control for DateTime fields which also lets users pick time, which is not possible by the default DateTime control on work item form. To select a date or time, click the calendar icon on the right.
Pattern ControlA custom text control for string or multiline string fields which restricts the field value to a certain regex pattern. Note that the restriction would only work in this custom control as the pattern would not apply to the actual work item field. If users enter a wrong pattern in this control, it'll show an error below the control but the work item would still be saveable because work item form extensions cannot block work item save right now. In the example above, there are 2 instances of pattern control - the first one requires the value to be an email. The 2nd one requires it to be a phone number. If the value entered by user doesnt match the pattern, it'll show an error. If the value matches the pattern, then no error would be shown. Note that work item would still be saveable even if the control shows error.
Some common regex patterns
Slider ControlA custom control that shows a numeric field as a slider control
Rating ControlA custom control that shows an integer field as a star rating control
Autocomplete MultivalueA custom control that lets user pick multiple values for a string (or a multiline string) field using an autocomplete widget.
Plain Text ControlA custom control that shows the configured markdown string as text. This control is not bound to any field. It supports markdown (https://github.com/markdown-it/markdown-it), so you can show rich text with links and images if you choose so. The control also looks for certain "patterns" in the string where it can replace certain text dynamically. For eg.- You can use ${@fieldValue} macro anywhere in the text and this text will be replaced during runtime by reading the field value from current work item. Eg: If the configured text is -
It would be printed as -
|