0

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();    
abatishchev
  • 98,240
  • 88
  • 296
  • 433
CodeNinja
  • 3,188
  • 19
  • 69
  • 112

1 Answers1

2

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

Oleg Mikhaylov
  • 1,124
  • 7
  • 10