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


##########
backend/plugins/jira/tasks/issue_extractor.go:
##########
@@ -143,7 +145,39 @@ func extractIssues(data *JiraTaskData, mappings 
*typeMappings, apiIssue *apiv2mo
                }
 
        }
-
+       // default due date field is "duedate"
+       dueDateField := "duedate"
+       if data.Options.ScopeConfig != nil && 
data.Options.ScopeConfig.DueDateField != "" {
+               dueDateField = data.Options.ScopeConfig.DueDateField
+       }
+       unknownDueDate := apiIssue.Fields.AllFields[dueDateField]
+       switch dd := unknownDueDate.(type) {
+       case string:
+               // string, try to parse
+               if dd == "" || dd == "null" {
+                       break
+               }
+               // use loc of issue.Created if dd is of type date (yyyy-MM-dd)
+               isDateStr, _ := regexp.Match(`\d{4}-\d{2}-\d{2}`, []byte(dd))
+               var temp time.Time
+               if isDateStr {
+                       temp, _ = common.ConvertStringToTimeInLoc(dd, 
issue.Created.Location())
+               } else {
+                       temp, _ = common.ConvertStringToTime(dd)

Review Comment:
   fixed



-- 
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