public async Task EnsureExceptionWorkItemType(Guid processId, string processName, string workItemTypeName) { var witReferenceName = $"{processName}.{workItemTypeName}"; var processWorkItemType = await GetWorkItemType(processId, witReferenceName); if (processWorkItemType == null) { var createWorkItemType = new CreateProcessWorkItemTypeRequest() { Name = workItemTypeName, Description = "Used for tracking unhandled application exceptions", Color = "f6546a", Icon = "icon_airplane", //InheritsFrom = "Microsoft.VSTS.WorkItemTypes.Bug" }; processWorkItemType = await witProcessClient.CreateProcessWorkItemTypeAsync(createWorkItemType, processId); } await EnsureFieldExists("Custom.ExceptionApplication", "Application", "Application", processWorkItemType.ReferenceName, processId); //Add page var page = witProcessClient.AddPageAsync(new Page() { Label = "Exception", PageType = PageType.Custom, Sections = new List <Section>() { new Section() { Id = "Section1", Groups = new List <Group>() { new Group() { Label = "MyGroup", Controls = new List <Control>() { new Control() { Id = "Custom.ExceptionApplication", Label = "Application", ControlType = "FieldControl", Name = "Application", Visible = true } } } } } } }, processId, processWorkItemType.ReferenceName).Result; ////Add fields //var fields = new string[] //{ // TfsStoreWithException.Application, // TfsStoreWithException.AssignedToFieldName, // TfsStoreWithException.CommentFieldName, // TfsStoreWithException.RefCountFieldName, // TfsStoreWithException.ExceptionReporterFieldName, // TfsStoreWithException.BuildVersionFieldName, // TfsStoreWithException.ExceptionMessageFieldName, // TfsStoreWithException.ExceptionTypeFieldName, // TfsStoreWithException.ClassFieldName, // TfsStoreWithException.MethodFieldName, // TfsStoreWithException.SourceFieldName, // TfsStoreWithException.StackTraceFieldName, // TfsStoreWithException.StackChecksumFieldName, // TfsStoreWithException.AssemblyName // }; }