public void logWorkAndLeaveRemainingUnchanged(string key, string timeSpent, DateTime startDate, string comment)
        {
#if PLVS_133_WORKAROUND
            ConstructorInfo constructor = getRemoteWorklogConstructor(key);
            object          worklog     = createWorklogObject(constructor, timeSpent, startDate, comment);
            service.addWorklogAndRetainRemainingEstimate(Token, key, worklog);
#else
            RemoteWorklog worklog = new RemoteWorklog {
                timeSpent = timeSpent, startDate = startDate
            };
            service.addWorklogAndRetainRemainingEstimate(Token, key, worklog);
#endif
        }
Exemple #2
0
        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");
            }
        }