Why can't I remove my Allowed Values rule from a custom field in a Work Item Template? - tfs

We have two customized Work Item Templates (Bug and Product Backlog Item (PBI)) that both contain a custom field (Change Request Number). In both templates we had added a custom ALLOWEDVALUES rule for that field, where we referenced some globallist.
Now we want to remove that restriction - we want it to be freely editable. So I removed the rule from both templates, imported them, and created both a Bug and Product Backlog Item. I then noticed the Bug working as expected (showing a simple textbox), while the PBI still showed the dropdown list containing the globallist values for that field.
I'm sure I imported the templates correctly, as changing stuff like textlabels does get reflected. What might going on here, and how can I fix the PBI templates as well?

Just tried creating a custom field with ALLOWEDVALUES rule in PBI with TFS PowerTools, then removed the rule. The PBI work item worked as expected.
Removing a rule from a field is an easy operation, I'd like to suggest you install TFS PowerTools to double check the PBI. Also, if the issue only exists in VS, try to clean the cache folder C:\Users\username\AppData\Local\Microsoft\Team Foundation\x.0\Cacheto see whether it is helpful.
By the way, my test environment is TFS2015.3 + VS2015.3.

Apparently you can put rules on states and transitions as well. In this case there was the same Allowed Values rule applied on the "New" state in de PBI template. Removing that one solved my problem.

Related

Adding new "tab" to a bug work item in TFS 2017

I am trying to add a new "tab" to bug item in TFS 2017. Looking at the "tabs" you see things like "Steps to Reproduce", System, etc.
I have found information on changing work item types but nothing about adding a new "tab" across the top where you see Steps to Repro, System, Test Cases, Tasks. The change I want to make may not be possible? Or it is possible I don't know the correct verbiage to use when asking google. The think I want to change may not be a tab control at all it maybe something else different.
Thanks
***************** Updated questions after posting *****************************
After playing around with Process Editor -> WIT -> Open WIT from server -> Bug
as suggested by Andy Li-MSFT I don't see a lot of control on the formatting on the tab. I was planning to add fields in a grid like pattern like a table as shown below. I am able to get the values in the drop down list for field1 and add the fields. However I have a couple follow up questions if you have time.
Setting either the control or column for the control to read-only the column will not render when adding a new bug. I have a little more control if I set AllowedValues and Frozen for the column however the value can still be changed. Is there a better way to set read-only?
There is not much control on the layout. I am OK adding a lot of fields but would like them to be displayed in a table like structure. Is there a way to control the look of the fields on the form?
Is there a way to add the fields in a grid? This would be ideal so I only have one header for each column.
The last-updated-by and last-updated-date. Is it possible to track on a row level who made a change? If not I would be OK just adding a last updated by and last updated date to the new tab. Row level updates would be nice.
<pre>
Field 1 Field 2 (Read-only) Field 3 Last Updated By Last updated Date
Status (completed, empty, N/A) "Some text here which describes something to do" "Optional comments" tfs user name date/time
Status (completed, empty, N/A) "Some text here which describes something to do" "Optional comments" tfs user name date/time
</pre>
You need to modify the WIT definition file (Bug work item type in your scenario).
You can try below ways to do that:
Export the WIT definition file with witadmin commands, add a new tab under <TabGroup> and add a new control for it, then save and import the file. See Import, export, and manage work item types for details.
e.g:
<Tab Label="Tab0501">
<Control FieldName="System.ChangedDate" Type="DateTimeControl" Label="Test0501:" LabelPosition="Left" />
</Tab>
You can also use the TFS Power Tools to export/import WIT definition files or directly modify the files from server:
Visual Studio 2015 : Microsoft Visual Studio Team Foundation Server
2015 Power Tools
Visual Studio 2017 : TFS Process Template Editor
Reference below screenshot to do that.
Another way is writing an extension to Extend the work item form, you can reference my answer in another thread to do that.

Workflow to apply scripts in homologation/production

I'm using TFS's workitens to DBA's team apply scripts in homologation/production, so, i'm creating a workitem and linking BD's scripts in it. To make sure that nobody will change the script after i created the workitem, the DBAs team is locking the scripts in TFS before aplly. I think there is another tool or method to make it safer and smarter
You can give a try with this workaround by Angela Dugan, In short the solution of Angela works as follows:
Add a field [UserAccessDenied] to a work item but do not show this
on the form In the desired state add a rule [REQUIRED] for a certain
group
Because you can not enter a value, you can never save the work item,
so it is “sort of” read only.
For example, after setting only you in can make a state transition from [Active] to [Resolved]

TFS 2010: Change 'Work Item' type from 'Product Backlog Item' to 'Task' - how to?

I want to change the type of a 'Work Item' in TFS 2010: I entered a Work Item to the Product Backlog (we're using a Scrum template), and then I entered several 'Child' tasks, but I entered them as 'Product Backlog Items'. I should have entered them as 'Tasks'. How can I change them to appear as Tasks - children of the original 'Work Item'.
A previous question: Change TFS Work Item Type
would suggest that this is not simple. Can anyone help?
#PortageMonkey's answer to the question you quote contains pretty much what you need.
As noted you cannot directly change the work item type however there
is a nice shortcut that may save you a lot of time for these
scenarios. It will automatically copy links to change sets, test cases
etc.
Right-click on your work item and select "Create Copy of Work Item"
The following dialog window will pop up where you can then change the work item type for the new item:
Result: A new work item is
created with the new type and the old one automatically added as a
link and a comment added to the history area stating the work item ID
it was copied from.
So, use this feature to copy them and convert them to tasks at the same time by choosing "task" in the copy dialog. Once the copy is done, flag the original item to "removed".
Changing a work item's type is now possible by right-clicking the work item in the web view and choosing Change Type:
Here's the link referenced in the screenshot above.

Set a default iteration path for a work item type on TFS

I try to tune my Team Foundation 2005 work items.
We have 5 iterations paths in the "Bug" work item type.
I would like it to default to a specific value, for example Iterations.Iteration2
I tried to add a DEFAULT rule in the work item type editor but couldn't set the iteration path.
How can I do that?
I'm getting the same error with TFS 2010 when I try to set a default rule for a work item type for a default iteration path.
It seems the rules engine for work items unfortunately doesn't allow this (as explained by this post and others I've seen around).
Create a Work Item Template.
If you're using VS, you'll need the Power Tools. If you're using the web interface, the feature is already built-in.

How to add more items to Priority dropdown in TFS work item

I've created TFS project based on MSF for CMMI process template.
For any type of work item I can only select priority between 1 and 3 which is not enough precise for our process.
How can I widen this priority range, so that I have, for example, priorities 1-8 using process explorer UI?
Adding values to TFS Work Item dropdown the GUI way
Install TFS PowerTools
Open Visual Studio
Go to Tools>Process Editor>Work Item Types>Open WIT from Server
Open the WIT that you want to edit
The Work Item Type will have three tabs : Fields, Layout, and Workflow
If you want to edit the dropdown values of field:Priority go to tab Fields.
Double click Priority - a new window opens with 2 tabs: Field Definition and Rules
Under Rules tab you will find ALLOWEDVALUES.
Edit ALLOWEDVALUES to change values or add new ones to the dropdown.
You will need to edit the work item template. To do so, export a copy of the work item template using witexport. Next you will need to make changes to the allowable values, either in XML or by using the Work Item Template Editor included with Team Foundation Server Power Tools. Finally, reimport the updated workitem template using witimport.
Hope that helps.

Resources