private async Task <List <CustomWorkItem> > GetCustomWorkItemsForIssue(TimeTrackingService timeTrackingService, Issue issue)
        {
            var result = new List <CustomWorkItem>();

            try
            {
                var workItems = await timeTrackingService.GetWorkItemsForIssue(issue.Id).ConfigureAwait(false);

                return(workItems
                       .Where(wi => wi.Author.Login == "m.magomedov")
                       .Select(wi => new CustomWorkItem()
                {
                    Issue = issue,
                    Date = wi.Date.Value,
                    Duration = wi.Duration
                }).ToList());
            }
            catch (Exception ex)
            {
                // MessageBox.Show(ex.Message);
                return(new List <CustomWorkItem>());
            }
        }
        private async Task <List <CustomWorkItem> > GetCustomWorkItemsForProject(IssuesService issueService, TimeTrackingService timeTrackingService, Project project)
        {
            var issues = new List <Issue>();

            try
            {
                issues.AddRange(await issueService.GetIssuesInProject(project.ShortName, take: 5000).ConfigureAwait(false));
            }
            catch (Exception ex)
            {
                // MessageBox.Show(ex.Message);
            }

            var workItemsTasks = issues.Select(i => GetCustomWorkItemsForIssue(timeTrackingService, i)).ToArray();
            var customItems    = await Task.WhenAll(workItemsTasks).ConfigureAwait(false);

            return(customItems.SelectMany(x => x).ToList());
        }