likyh commented on code in PR #4408:
URL: 
https://github.com/apache/incubator-devlake/pull/4408#discussion_r1104470725


##########
plugins/jira/tasks/issue_collector.go:
##########
@@ -58,24 +58,23 @@ func CollectIssues(taskCtx core.SubTaskContext) 
errors.Error {
                        Table store raw data
                */
                Table: RAW_ISSUE_TABLE,
-       }, data.CreatedDateAfter)
+       }, data.CreatedDateAfter, data.UpdatedDateAfter)
        if err != nil {
                return err
        }
 
        // build jql
        // IMPORTANT: we have to keep paginated data in a consistence order to 
avoid data-missing, if we sort issues by
        //  `updated`, issue will be jumping between pages if it got updated 
during the collection process
-       createdDateAfter := data.CreatedDateAfter
        jql := "created is not null ORDER BY created ASC"
-       if createdDateAfter != nil {
-               // prepend a time range criteria if `since` was specified, 
either by user or from database
-               jql = fmt.Sprintf("created >= '%v' AND %v", 
createdDateAfter.Format("2006/01/02 15:04"), jql)
-       }
 
        incremental := collectorWithState.IsIncremental()
        if incremental {
                jql = fmt.Sprintf("updated >= '%v' AND %v", 
collectorWithState.LatestState.LatestSuccessStart.Format("2006/01/02 15:04"), 
jql)
+       } else if data.UpdatedDateAfter != nil {
+               jql = fmt.Sprintf("updated >= '%v' AND %v", 
data.UpdatedDateAfter.Format("2006/01/02 15:04"), jql)
+       } else if data.CreatedDateAfter != nil {
+               jql = fmt.Sprintf("created >= '%v' AND %v", 
data.CreatedDateAfter.Format("2006/01/02 15:04"), jql)

Review Comment:
   The logic changed when `CreatedDateAfter != nil`. It will collect 
`issue.created< CreatedDateAfter && issue.updated> LatestSuccessStart` now but 
it won't before.



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