From 27af894759902f79bbd100f6f409d6b4e82974ad Mon Sep 17 00:00:00 2001 From: Danil Kislov Date: Fri, 15 Mar 2019 13:51:38 +0300 Subject: [PATCH] =?UTF-8?q?Dummy=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D1=82=D0=B0=D1=80=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JiraTimeBotForm/JiraIntegration/JiraApi.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/JiraTimeBotForm/JiraIntegration/JiraApi.cs b/JiraTimeBotForm/JiraIntegration/JiraApi.cs index a397818..bf37a8c 100644 --- a/JiraTimeBotForm/JiraIntegration/JiraApi.cs +++ b/JiraTimeBotForm/JiraIntegration/JiraApi.cs @@ -13,6 +13,12 @@ namespace JiraTimeBotForm.JiraIntegration private readonly ILog _log; private Jira _jira; + private readonly List _dummyComments = new List + { + "Написание кода", "написание кода", "программирование", "реализация задачи", "кодинг", "код + тесты", + "кодинг", "написание кода и тестов" + }; + public JiraApi(Settings settings, ILog log = null) { _settings = settings; @@ -86,11 +92,14 @@ namespace JiraTimeBotForm.JiraIntegration if (!hasTodayWorklog) { var timeSpentJira = $"{taskTimeItem.Time.TotalMinutes}m"; - Worklog workLogToAdd = new Worklog(timeSpentJira, date.Value); + + var comment = _dummyComments.OrderBy(x => Guid.NewGuid()).FirstOrDefault(); if (addCommentsToWorklog) { - workLogToAdd = new Worklog(timeSpentJira, date.Value, taskTimeItem.Description); + comment = taskTimeItem.Description; } + + Worklog workLogToAdd = new Worklog(timeSpentJira, date.Value, comment); if (!dummy) { workLogToAdd = issue.AddWorklogAsync(workLogToAdd).Result;