public void WriteAggregate() { var targetTicket = GetAggregateTicket(); var prefixes = GetYoutrackAggregatePrefixes(); if (prefixes == null || !prefixes.Any()) { Console.WriteLine("No prefixes for aggregation specified."); return; } var youtrackIssues = _workItemStore.GetState().WorkItemArchive; youtrackIssues = youtrackIssues.Where(issue => prefixes.Any(prefix => issue.TicketNumber.StartsWith(prefix))).ToList(); var aggregatesPerDay = WorkItemAggregator.AggregateToSingleWorkItemPerDay(youtrackIssues, targetTicket); if (aggregatesPerDay == null || !aggregatesPerDay.Any()) { Console.WriteLine("No aggregates to process."); return; } _successfullyLoggedItems.Clear(); foreach (var workItem in aggregatesPerDay) { TrackTime(workItem); } }
public List <string> WriteEntireArchive() { var jiraIssues = _workItemStore.GetState().WorkItemArchive; var prefixes = GetJiraIssuePrefixes(); if (prefixes != null && prefixes.Any()) { jiraIssues = jiraIssues.Where(issue => prefixes.Any(prefix => issue.TicketNumber.StartsWith(prefix))).ToList(); } var aggregatedWorkItems = WorkItemAggregator.AggregateWorkItems(jiraIssues); _successfullyLoggedItems.Clear(); foreach (var workItem in aggregatedWorkItems) { TrackTime(workItem); } return(_successfullyLoggedItems); }