When I try to update the status of a work item using the following syntax, the "Work Item is not ready to save" error is issued.
wi.State = sState
wi.Reason = sReason
dim result = wi.Validate() ... more handling...
The work item type is the default "Task" type. I move it from "Active" to "Closed".
According to the Validation logic, the System.State item only Allows values for "Active" and "Resolved". The Prohibited values are "Closed".
According to the XML for the task type, there are no allowed or prohibited values for System.State. The Workflow only has two states (Active and Closed) and there are transitions between them. I can find no reference to "Resolved" anywhere. Nor can I find the "check-in" event I've seen referenced elsewhere.
Remarkably, even though the "wi.Save" throws an error, the State of the work item is changed from "Active" to "Closed".
So, why is it throwing the "Work Item is not ready to save" error when it is clearly saving the work item and no valid rules appear to have violated???