I am getting "InvalidListValue" error for all dropdown list fields in the WIT while saving the Work Item though TFS API.
I am trying to save the workitem using the below code :
ArrayList result = workItem.Validate();
if (result.Count <= 0)
{
productBackLogItem.Save();
}
But, the result contains 8 "InvalidListValue" validation errors for all dropdown fileds in the WIT (my WIT has 8 dropdown list fields).
When I remove "AllowedValues" from the Temaplate, it is working fine.
I verified, both the "SuggestedValues" and "AllowedValues" has the same values. Please find the details below.
<SUGGESTEDVALUES expanditems="true">
<LISTITEM value="Added" />
<LISTITEM value="Pending" />
</SUGGESTEDVALUES>
<ALLOWEDVALUES expanditems="true">
<LISTITEM value="Added" />
<LISTITEM value="Pending" />
</ALLOWEDVALUES>
When I try to access the list of AllowedValues thought API, it is showing the count as 0.
workItem.Fields["Sample.Control"].AllowedValues.Count
Thanks in Advance!