public void logWorkAndUpdateRemainingManually(string key, string timeSpent, DateTime startDate, string remainingEstimate, string comment) { #if PLVS_133_WORKAROUND ConstructorInfo constructor = getRemoteWorklogConstructor(key); object worklog = createWorklogObject(constructor, timeSpent, startDate, comment); service.addWorklogWithNewRemainingEstimate(Token, key, worklog, remainingEstimate); #else RemoteWorklog worklog = new RemoteWorklog { timeSpent = timeSpent, startDate = startDate }; service.addWorklogWithNewRemainingEstimate(Token, key, worklog, remainingEstimate); #endif }
internal void ProcessWorklog(JiraIssue issue, string timeSpent, TimeEstimateRecalcualationMethod method, string newTimeEstimate) { var remoteWorklog = new RemoteWorklog(); remoteWorklog.comment = "Time logged"; remoteWorklog.timeSpent = timeSpent; remoteWorklog.startDate = DateTime.Now; switch (method) { case TimeEstimateRecalcualationMethod.AdjustAutomatically: _service.addWorklogAndAutoAdjustRemainingEstimate(_token, issue.DisplayId, remoteWorklog); break; case TimeEstimateRecalcualationMethod.DoNotChange: _service.addWorklogAndRetainRemainingEstimate(_token, issue.DisplayId, remoteWorklog); break; case TimeEstimateRecalcualationMethod.SetToNewValue: _service.addWorklogWithNewRemainingEstimate(_token, issue.DisplayId, remoteWorklog, newTimeEstimate); break; default: throw new ArgumentOutOfRangeException("ProcessWorklog"); } }