d4x1 commented on code in PR #8316:
URL: 
https://github.com/apache/incubator-devlake/pull/8316#discussion_r1978480036


##########
backend/plugins/jira/tasks/apiv2models/issue.go:
##########
@@ -278,6 +279,17 @@ func (i Issue) toToolLayer(connectionId uint64) 
*models.JiraIssue {
                temp := *i.Fields.Timespent / 60
                result.SpentMinutes = &temp
        }
+       if i.Fields.Duedate != "" && i.Fields.Duedate != "null" {
+               // get timezone from i.Fields.Created
+               duedateStr := strings.Trim(i.Fields.Duedate, "\"")
+               // parse due date to time.Time
+               if i.Fields.Created != nil {
+                       loc := i.Fields.Created.ToTime().Location()
+                       if t, err := time.ParseInLocation("2006-01-02", 
duedateStr, loc); err == nil {
+                               result.DueDate = &t
+                       }

Review Comment:
   If something went wrong, I think errors should be logged, so we can work 
with more use cases.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to