TFS Api - Assign new work item to a responsible

0

I'm creating a new WorkItem and I need to change the responsible person (Field: Assigne To) by it. To create the WorkItem, do the following:

WorkItem workItem = new WorkItem(workItemType)
{    
    State = "A RESOLVER",
    Title = "[TESTE INTEGRAÇÃO] " + solicitacao.numero + " - " + solicitacao.descricao,
    AreaPath = ITERATION_PATH + "\" + solicitacao.tipo,
    Description = GetDescriptionMessage(solicitacao),
    IterationPath = GetCurrentIterationPath(ITERATION_PATH),
};
workItem.Save();

How do I get access to the AssignedTo field?

    
asked by anonymous 29.10.2015 / 13:26

1 answer

0

I have been able to find a solution, but I think there must be other ways. The AssignedTo field is inside the Fields property, so to access it is quite simple:

workItem.Fields[CoreField.AssignedTo].Value = value;

However I could not assign the value inside the constructor

//WorkItem workItem = new WorkItem(workItemType)
//{
//    Fields[CoreField.AssignedTo].Value = value
//}
    
29.10.2015 / 13:31