Share via


Importing Test Cases with required fields

Recently I saw that trying to use TCM testcases /import to pull in test cases for test methods in a DLL has some issues if the work item template is modified.  TCM was failing to create the test cases because the template had two items that were marked as required that were being set by referencing a field that was not set when the test case is first saved.  Below is an example of this scenario.

 

We found that the Microsoft.VSTS.TCM.AutomationStatus field was not a valid field to test when setting default values.  Instead, if you check for Microsoft.VSTS.TCM.AutomatedTestId, then you will be able to set your defaults.