DateTimeToJiraDateTime() public static method

public static DateTimeToJiraDateTime ( DateTimeOffset date ) : string
date DateTimeOffset
return string
示例#1
0
        public IRestRequest CreatePostWorklogRequest(string key, DateTimeOffset started, TimeSpan time, string comment, EstimateUpdateMethods adjustmentMethod, string adjustmentValue)
        {
            var request = restRequestFactory.Create(String.Format("/rest/api/2/issue/{0}/worklog", key.Trim()), Method.POST);

            request.RequestFormat = DataFormat.Json;
            request.AddBody(new
            {
                timeSpent = JiraTimeHelpers.TimeSpanToJiraTime(time),
                started   = JiraTimeHelpers.DateTimeToJiraDateTime(started),
                comment   = comment
            }
                            );
            switch (adjustmentMethod)
            {
            case EstimateUpdateMethods.Leave:
                request.AddQueryParameter("adjustEstimate", "leave");
                break;

            case EstimateUpdateMethods.SetTo:
                request.AddQueryParameter("adjustEstimate", "new");
                request.AddQueryParameter("newEstimate", adjustmentValue);
                break;

            case EstimateUpdateMethods.ManualDecrease:
                request.AddQueryParameter("adjustEstimate", "manual");
                request.AddQueryParameter("reduceBy", adjustmentValue);
                break;

            case EstimateUpdateMethods.Auto:
                request.AddQueryParameter("adjustEstimate", "auto");
                break;
            }
            AddAuthHeader(request);
            return(request);
        }
示例#2
0
        public IRestRequest CreatePostWorklogRequest(string key, DateTimeOffset started, TimeSpan time, string comment)
        {
            var request = restRequestFactory.Create(String.Format("/rest/api/2/issue/{0}/worklog", key.Trim()), Method.POST);

            request.RequestFormat = DataFormat.Json;
            request.AddBody(new
            {
                timeSpent = JiraTimeHelpers.TimeSpanToJiraTime(time),
                started   = JiraTimeHelpers.DateTimeToJiraDateTime(started),
                comment   = comment
            }
                            );
            return(request);
        }