2012년 2월 21일 화요일 오후 5:52
I'm using the Java SDK 10-1-0 and I can create Work Items successfully (as 'Bug' types), as per the snippet examples.
What I cannot see how to do however is to set extended properties on this bug, eg, Priority & Severity. I would also like to be able to have the 'description' information displayed in the 'Detail' panel within TFS.
Does the API allow for this? If not, is there another approach I should be taking for setting these properties?
2012년 2월 22일 수요일 오전 9:34
Ok, I've worked this out now.
To get a complete list of available fields for a work item you can use this code:
for (Field fieldDefinition : newWorkItem.getFields())
System.out.println(fieldDefinition.getReferenceName() + "[" + fieldDefinition.getName() + "]");
And from there, updating specific fields is a case of referencing the fieldDefinition.getName() field name.
What I don't understand is why only some of these fields are listed in the CoreFieldReferenceNames list. Presumably they aren't deemed 'Core'?
Anyway, for my specific issue this has got me over the hump.
// Update priority
// Update severity
// Add reproduction detail
- 답변으로 표시됨 Martin WoodwardMicrosoft Employee, Owner 2012년 2월 22일 수요일 오전 10:07
2012년 2월 22일 수요일 오전 10:07소유자
You got it. The "Core" fields are the ones in all work items, things like what Team Project the work item is for etc. Things like Priority, Severity etc are all dependent on the particular process template being used for that Team Project. Indeed, core fields like Title or Description might even be not populated in some process templates.
The huge degree of flexibility that customers have over their process templates is one of the major benefits of TFS - however it can make making generic code that works against all process templates a bit of a challenge.