Saturday, August 18, 2012 1:02 AM
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???
Saturday, August 18, 2012 1:55 AMI'm a moron. It was a Bug work item as opposed to a Task.
- Marked As Answer by DaveIII Saturday, August 18, 2012 1:55 AM
Monday, August 20, 2012 12:37 AMModerator
I’m glad to hear that the issue is resolved. Thank you for sharing your solution & experience here.
Lily Wu [MSFT]
MSDN Community Support | Feedback to us