How to set 'Assigned to' in TFS Work item

2019-05-12 17:54发布

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";

Currently I am setting the TFS user display name. I have following doubts.

Is Display name in TFS is unique?

If not how to set a unique name like account name as assigned to?

2条回答
女痞
2楼-- · 2019-05-12 18:16

Display new is the only value that you can use to at this field in a work item.

You can query the user identity system and retrieve the display name from TFS for the user that you want.

查看更多
啃猪蹄的小仙女
3楼-- · 2019-05-12 18:28

What about

newWorkItem.Fields[CoreField.AssignedTo].Value ="person";
查看更多
登录 后发表回答