Reputation: 1164
In my WITD, I have some xml like this in my FIELD tag:
<ALLOWEDVALUES expanditems="true">
<LISTITEM value="Yes" />
<LISTITEM value="No" />
</ALLOWEDVALUES>
<DEFAULT from="value" value="No" />
I can get the allowed values from the API by getting an instance of class FieldDefinition and referencing the AllowedValues property.
How can I get the DEFAULT tag's value from the Api?
Upvotes: 1
Views: 198
Reputation: 14164
There's no API for retrieving default values. Another approach is to parse the value from the WITD XML using WorkItemType.Export Method
var xml = wit.Export(false);
Upvotes: 1
Reputation: 1377
You could create a new work item with a work item type that has your field and then check the value of the field on the new work item. You don't need to save the work item to check the field value. It should contain the default value you are after.
Upvotes: 1