Spider man Spider man - 1 year ago 108
C# Question

How to set 'Assigned to' in TFS Work item through code?

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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download