public List <string> WriteEntireArchive()
        {
            var prefixes = GetYoutrackIssuePrefixes();

            var youtrackIssues = _workItemStore.GetState().WorkItemArchive;

            if (prefixes != null && prefixes.Any())
            {
                youtrackIssues = youtrackIssues.Where(issue => prefixes.Any(prefix => issue.TicketNumber.StartsWith(prefix))).ToList();
            }

            var aggregatedWorkItems = WorkItemAggregator.AggregateWorkItems(youtrackIssues);

            _successfullyLoggedItems.Clear();

            foreach (var workItem in aggregatedWorkItems)
            {
                TrackTime(workItem);
            }

            return(_successfullyLoggedItems);
        }
Exemple #2
0
        public void StartWorkItem(WorkItem workItem)
        {
            if (_workItemStore.GetState().CurrentWorkItem != WorkItem.Empty)
            {
                StopCurrentWorkItem();
            }

            _workItemStore.SetCurrent(workItem);

            Console.WriteLine($"Starting work on ticket {workItem.TicketNumber} with comment '{workItem.Comment}' at '{workItem.Started.ToShortTimeString()}'");
        }