Reputation: 3278
Can anyone tell me how I can access the properties "Blocked" & "Root cause" of a Work Item?
I tried the following but it doesn't seem to be right:
// Code to connect to TFS
WorkItem workItem = workItemStore.GetWorkItem(1234);
string blocked = workItem.Fields["Blocked"].Value.ToString();
string rootCause = workItem.Fields["Root Cause"].Value.ToString();
Upvotes: 0
Views: 616
Reputation: 1124
The code seems correct to me. What is the type of the work item you are using? What is the process template of the team project?
"Blocked" field only exists in 'Bug', 'Requirement', 'Risk', 'Task' types in CMMI process template and 'Task' type in Scrum template. "Root Cause" field exists in 'Bug' and 'Issue' types in CMMI process template
Upvotes: 2