Tuesday, April 24, 2012

TF237124: Work Item is not ready to save

For a project I had to create some TFS Work Items programmatically using the TFS API. However saving the work item resulted in the following error message:
TF237124: Work Item is not ready to save
This error message doesn’t expose any useful information. What’s important to know is that you can configure a lot of rules before a work item is valid. If one of these rules is invalid, saving the work item will result in the above error message. Therefore it’s important to validate the WorkItem prior to save. The validate() method will return an arraylist of invalid fields.
ArrayList result= wi.Validate();


So what’s inside this arraylist? A quick sample:


InvalidWI


This will give you all the information you need to know why this workitem cannot be saved.(In this case the field System.State has an InvalidListValue).

7 comments:

Anonymous said...

Thanks for the tip!!!!!! Validate was exactly what I was looking for.

Anonymous said...

Hi, Thanks very much!
it's very helpfull!

Anonymous said...

Thanks ...it was helpful

Bruno de Fran├ža Valli said...

Helped me a lot. Thank you!

Adam Ashraf said...

I am getting this from Visual Studio. How can I achieve this without code?

Anonymous said...

In my case there was nothing in Validate. I was able to write to other fields. Upon closer inspection my field was associated with a list, and the value I was trying to set was not in the list.

Baskar Lingam said...

Awesome. Did helped me.