You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ab...@apache.org on 2023/09/07 06:32:10 UTC

[incubator-devlake] branch fix-zentao-sprint-bug updated: fix: update completed_date and started_date logic

This is an automated email from the ASF dual-hosted git repository.

abeizn pushed a commit to branch fix-zentao-sprint-bug
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/fix-zentao-sprint-bug by this push:
     new 9fdaef6a2 fix: update completed_date and started_date logic
9fdaef6a2 is described below

commit 9fdaef6a222b1b762dce7421ac481857f55ca8db
Author: abeizn <zi...@merico.dev>
AuthorDate: Thu Sep 7 06:32:00 2023 +0000

    fix: update completed_date and started_date logic
---
 backend/plugins/zentao/tasks/execution_convertor.go | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/backend/plugins/zentao/tasks/execution_convertor.go b/backend/plugins/zentao/tasks/execution_convertor.go
index fdf900d71..91bb92f4f 100644
--- a/backend/plugins/zentao/tasks/execution_convertor.go
+++ b/backend/plugins/zentao/tasks/execution_convertor.go
@@ -93,12 +93,17 @@ func ConvertExecutions(taskCtx plugin.SubTaskContext) errors.Error {
 				Name:            toolExecution.Name,
 				Url:             fmt.Sprintf("%s/execution-view-%d.html", homePage, toolExecution.Id),
 				Status:          domainStatus,
-				StartedDate:     toolExecution.RealBegan.ToNullableTime(),
 				EndedDate:       toolExecution.PlanEnd.ToNullableTime(),
-				CompletedDate:   toolExecution.RealEnd.ToNullableTime(),
+				CompletedDate:   toolExecution.ClosedDate.ToNullableTime(),
 				OriginalBoardID: projectIdGen.Generate(toolExecution.ConnectionId, data.Options.ProjectId),
 			}
 
+			if domainStatus == `FUTURE` {
+				sprint.StartedDate = toolExecution.PlanBegin.ToNullableTime()
+			} else {
+				sprint.StartedDate = toolExecution.RealBegan.ToNullableTime()
+			}
+
 			boardSprint := &ticket.BoardSprint{
 				BoardId:  sprint.OriginalBoardID,
 				SprintId: sprint.Id,