CodeNinja
CodeNinja

Reputation: 3278

Accessing TFS Work Item Properties "Blocked" & "Root Cause" using TFS API

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

Answers (1)

Oleg Mikhaylov
Oleg Mikhaylov

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

Related Questions