Compare commits

..
1 Commits
4 changed files with 51 additions and 35 deletions
+1 -1
View File
@@ -1 +1 @@
1.0.42 1.0.43
+18 -2
View File
@@ -145,7 +145,15 @@ namespace JiraTimeBot.JiraIntegration
} }
if (!dummy) if (!dummy)
{ {
issue.DeleteWorklogAsync(workLog, token: cancellationToken); try
{
issue.DeleteWorklogAsync(workLog, token: cancellationToken);
}
catch (Exception ex)
{
_log.Error($"Не могу удалить Worklog по задаче {taskTimeItem.Branch}: {ex.Message}.");
continue;
}
} }
hasTodayWorklog = false; hasTodayWorklog = false;
} }
@@ -163,7 +171,15 @@ namespace JiraTimeBot.JiraIntegration
Worklog workLogToAdd = new Worklog(timeSpentJira, date.Value, comment); Worklog workLogToAdd = new Worklog(timeSpentJira, date.Value, comment);
if (!dummy) if (!dummy)
{ {
workLogToAdd = issue.AddWorklogAsync(workLogToAdd, token: cancellationToken).Result; try
{
workLogToAdd = issue.AddWorklogAsync(workLogToAdd, token: cancellationToken).Result;
}
catch (Exception ex)
{
_log.Error($"Не могу добавить Worklog по задаче {taskTimeItem.Branch}: {ex.Message}.");
continue;
}
} }
_log.Trace($"Добавили Worklog для {taskTimeItem.Branch}: {workLogToAdd.Author} {workLogToAdd.CreateDate}: {workLogToAdd.TimeSpent}"); _log.Trace($"Добавили Worklog для {taskTimeItem.Branch}: {workLogToAdd.Author} {workLogToAdd.CreateDate}: {workLogToAdd.TimeSpent}");
} }
@@ -37,7 +37,7 @@ namespace JiraTimeBot.JiraIntegration
var comments = issue.GetCommentsAsync(cancellationToken).Result?.ToList() ?? new List<Comment>(); var comments = issue.GetCommentsAsync(cancellationToken).Result?.ToList() ?? new List<Comment>();
var user = settings.JiraUserName; var user = settings.JiraUserName;
//user = "Zoya.Aleksandridi"; user = "Zoya.Aleksandridi";
var userComments = comments.Where(f => f.Author.Equals(user, StringComparison.InvariantCultureIgnoreCase)).ToList(); var userComments = comments.Where(f => f.Author.Equals(user, StringComparison.InvariantCultureIgnoreCase)).ToList();
_log.Trace($"Получены комментарии по задаче {issue.Key} ({issue.Type?.Name}): {userComments.Count}."); _log.Trace($"Получены комментарии по задаче {issue.Key} ({issue.Type?.Name}): {userComments.Count}.");
+3 -3
View File
@@ -26,6 +26,6 @@ using System.Runtime.InteropServices;
// //
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.42")] [assembly: AssemblyVersion("1.0.43")]
[assembly: AssemblyFileVersion("1.0.42")] [assembly: AssemblyFileVersion("1.0.43")]
[assembly: AssemblyInformationalVersion("1.0.42")] [assembly: AssemblyInformationalVersion("1.0.43")]