Workflow to apply scripts in homologation/production - tfs

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]

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.

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

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.

How to Create Multi-Valued List in Team Foundation Server/Microsoft Test Manager?

I am working on VSTS 2010 and using Microsoft Test Manager to manage our team's test cases. I just want to add a custom field for Test Categories (with values like BVT, FVT, Regression etc..) to the existing Test case template by following the steps here and here. But I am not able to select multiple values. I am able to create a drop down list with one of these values can be selected but not more than one. but since a test case can be part of more than one test category, how can I make this possible?
My steps:
In Process Editor, Work item types I Create a new field called Test Category with Ref Name as MyCustomField
In Rules, I selected AllowedValues as BVT, FVT, Regression.
After that, In Layout tab created a new control with name Test Categories
4.The field name of the control is set to MyCustomField
When I checked in MTM to create a new test case, the control is showing as drop down instead of one that was shown here
The control you are trying to use is strictly 1 to 1 (does not allow for multiple values), so there isn't really a simple answer to this question, but here are some options:
1- Create 3 custom fields BVT, FVT, and Regression each with a yes/no input.
2- Follow the steps here: Multi-value list control
3- Upgrade to VS2012 and use tagging.

How to remove hours from Scrum 2.0 template

We are currently using Scrum 2.0 process template from microsoft in new TFS 2012, however we don't use hours as task estimates, we simply count tasks. This is easily archieved by setting each task value as 1 as default and set that field read only in task property form.
However original template uses hours as unit with tasks, so there are are mark "h" all around template. Is there way to get rid of this hour mark since it causes constant confusion? Especially in management.
You can configure how the remaining work is displayed, by modifying the format attribute in the following row in the commonconfiguration.xml file:
<TypeField refname="Microsoft.VSTS.Scheduling.RemainingWork" type="RemainingWork" format="{0} h" />
By default this attribute is "{0} h", so you can simply set it to "{0}" to fit your needs.
You can download the commonconfiguration.xml file from the server, using the witadmin command:
witadmin exportcommonprocessconfig /collection:http:<your collection> /p:<your project> /f:<the file name>
After editing the file you must import it back into TFS using witadmin command:
witadmin importcommonprocessconfig ...the same parameters as above
Note: with the RC it looks like you must leave a space after the placeholder, like "{0} ", otherwise you will get a validation error, when importing the file. I haven't tried yet with the RTM to see if this has been fixed.
As far as I can tell, all of those h's are hardcoded straight into web access. So the only way to remove them would be to find them (I used Chrome's dev tools), isolate them, and then go into the Web Access pages located on your TFS Server (application tier) and manually remove them. This is because they aren't actually part of any template, so there isn't a way to remove them all at once. The path to the files will be something like
c:\Program Files\Microsoft Team Foundation Server 11.0\Application Tier\Web Services
Good luck, I've had a heck of a time trying to alter them.
You can use TFPT or the WITADMIN command line tool to remove the remaining effort field.
I would suggest however not to remove it, but rather to remove it from the form itself (so that it just doesn't show), and add a rule so that it defaults to 1 and is read-only. Furthermore, in the workflow, add a rule that changes the value to 0 when you reach done.
Since there's no actual meaning to the number itself, the units can be actual hours, ideal hours, story points or whatever you want them to mean. By making each task 1 or 0 (when done), you can make use of TFS' built in tools such as the burndown reports to track your progress. Each task done will reduce the remaining work, and you will be able to keep track of velocity by summing up the effort completed in each iteration (which is the same as counting).

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.

Resources