public static WorkItem Copy(WorkItem srcItem, string targetProjectName)
        {
            var srcTypeName = srcItem.Type.Name;

            var targetProject = Store.Projects[targetProjectName];
            var targetType = targetProject.WorkItemTypes[srcTypeName];

            var copiedItem = srcItem.Copy(targetType, WorkItemCopyFlags.CopyFiles);

            copiedItem.WorkItemLinks[0].Comment = "History Ref";

            return copiedItem;
        }
Esempio n. 2
0
 /// <summary>
 /// Creates a copy of this WorkItem instance.
 /// </summary>
 /// <returns>A new WorkItem instance that is a copy of this WorkItem instance.</returns>
 public IWorkItem Copy()
 {
     return(ExceptionHandlingDynamicProxyFactory.Create <IWorkItem>(new WorkItemProxy(_item.Copy())));
 }