本文整理汇总了C#中Issue.GetWorklogs方法的典型用法代码示例。如果您正苦于以下问题:C# Issue.GetWorklogs方法的具体用法?C# Issue.GetWorklogs怎么用?C# Issue.GetWorklogs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Issue
的用法示例。
在下文中一共展示了Issue.GetWorklogs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCurrentLoggedTimeForDate
public TimeSpan GetCurrentLoggedTimeForDate(Issue jiraIssue, DateTime date)
{
var loggedTime = new TimeSpan();
foreach (var worklog in jiraIssue.GetWorklogs().Where(worklog => worklog.StartDate.HasValue &&
worklog.StartDate.Value.Date == date.Date &&
worklog.Author.ToLower() == jiraConnectionSettings.JiraUsername.ToLower()))
{
loggedTime = loggedTime.Add(new TimeSpan(0, 0, (int)worklog.TimeSpentInSeconds));
}
return loggedTime;
}
示例2: ExportTimerWindow
public ExportTimerWindow(IBackend gallifrey, Guid timerGuid)
{
this.gallifrey = gallifrey;
timerToShow = gallifrey.JiraTimerCollection.GetTimer(timerGuid);
InitializeComponent();
jiraIssue = gallifrey.JiraConnection.GetJiraIssue(timerToShow.JiraReference);
var loggedTime = new TimeSpan();
foreach (var worklog in jiraIssue.GetWorklogs())
{
if (worklog.StartDate.HasValue && worklog.StartDate.Value.Date == timerToShow.DateStarted.Date && worklog.Author.ToLower() == gallifrey.JiraConnectionSettings.JiraUsername.ToLower())
{
loggedTime = loggedTime.Add(new TimeSpan(0, 0, (int)worklog.TimeSpentInSeconds));
}
}
gallifrey.JiraTimerCollection.SetJiraExportedTime(timerGuid, loggedTime);
timerToShow = gallifrey.JiraTimerCollection.GetTimer(timerGuid);
if (timerToShow.TimeToExport.TotalMinutes <= 0)
{
MessageBox.Show("There Is No Time To Export", "Nothing To Export", MessageBoxButtons.OK, MessageBoxIcon.Information);
DisplayForm = false;
}
txtJiraRef.Text = timerToShow.JiraReference;
txtDescription.Text = timerToShow.JiraName;
txtTotalHours.Text = timerToShow.ExactCurrentTime.Hours.ToString();
txtTotalMinutes.Text = timerToShow.ExactCurrentTime.Minutes.ToString();
txtExportedHours.Text = timerToShow.ExportedTime.Hours.ToString();
txtExportedMins.Text = timerToShow.ExportedTime.Minutes.ToString();
txtExportHours.Text = timerToShow.TimeToExport.Hours.ToString();
txtExportMins.Text = timerToShow.TimeToExport.Minutes.ToString();
if (timerToShow.DateStarted.Date != DateTime.Now.Date)
{
calExportDate.Value = timerToShow.DateStarted.Date.AddHours(12);
}
else
{
calExportDate.Value = DateTime.Now;
}
}
示例3: GetWorklogs
public List<EffortLog> GetWorklogs(Issue issue)
{
var workLogs = new List<EffortLog>();
var rawWorklogs = issue.GetWorklogs().ToList();
foreach(var wl in rawWorklogs)
{
workLogs.Add(
new EffortLog
{
StartDate = wl.StartDate,
TimeSpent = wl.TimeSpent,
Hours = wl.TimeSpentInSeconds / 3600.0,
User = wl.Author
});
}
return workLogs;
}