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

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.

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.

Need to select multiple values as default dynamically in jenkins

In a prameter need to select multiple values as default dynamically in jenkins. Because need to run a scheduler on which multiple values should be selected as default. Any suggestion please.
You can use Extended Choice Parameter Plugin to select multiple valued for a variable.
After installing the plugin, in your project configuration page select This Project is Parameterized option and then from the drop-down choose Extended Choice Parameter.
Then add a name for your parameter and choose the parameter type as Multi Select. Then under Choose Source for Value section choose from where you want to take the vales for your parameter and save your job. In the following image I am providing the value in the job itself. You can choose alternate methods.
Now when you build your project you can select multiple values.
you can try to use source for default value
I would suggest Active Choices instead, using for example a simple checkbox configuration

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]

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 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