如何通过代码在TFS工作项中设置“分配给"?
问题描述:
我正在尝试通过代码创建工作项.目前,我正在使用以下代码来设置分配给".
I am trying to create a workitem through code. Currently I am using the following code to set Assigned to.
wi.Fields["System.AssignedTo"].Value = "TfsUser display name";
当前,我正在设置TFS用户的显示名称.我有以下疑问.
Currently I am setting the TFS user display name. I have following doubts.
TFS中的显示名称是否唯一?
Is Display name in TFS is unique?
如果不是,如何设置一个唯一的名称,例如分配给的帐户名?
If not how to set a unique name like account name as assigned to?
答
在工作项中的此字段中,只能使用显示新值".
Display new is the only value that you can use to at this field in a work item.
您可以查询用户标识系统,并从TFS中检索所需用户的显示名称.
You can query the user identity system and retrieve the display name from TFS for the user that you want.