From ab05664ff740af40944d96502706380aeba4dbf2 Mon Sep 17 00:00:00 2001 From: NaRro Date: Tue, 26 Nov 2024 16:35:39 +0800 Subject: [PATCH] fix: start date of sprint is empty (#8222) [Bug][Jira] start_date Field Empty in sprint Table After Upgrading DevLake from 0.21 to 1.0 with Jira Plugin #8221 --- backend/plugins/jira/e2e/sprint_test.go | 1 + .../plugins/jira/tasks/apiv2models/sprint.go | 19 +++++++------------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/backend/plugins/jira/e2e/sprint_test.go b/backend/plugins/jira/e2e/sprint_test.go index 0b1ef8ce8c4..17509e5f238 100644 --- a/backend/plugins/jira/e2e/sprint_test.go +++ b/backend/plugins/jira/e2e/sprint_test.go @@ -44,6 +44,7 @@ func TestSprintDataFlow(t *testing.T) { // verify sprint extraction dataflowTester.FlushTabler(&models.JiraSprint{}) dataflowTester.FlushTabler(&models.JiraBoardSprint{}) + dataflowTester.FlushTabler(&models.JiraServerInfo{}) dataflowTester.Subtask(tasks.ExtractSprintsMeta, taskData) dataflowTester.VerifyTable( models.JiraSprint{}, diff --git a/backend/plugins/jira/tasks/apiv2models/sprint.go b/backend/plugins/jira/tasks/apiv2models/sprint.go index bdb0a26d2ee..2abcb57e5ae 100644 --- a/backend/plugins/jira/tasks/apiv2models/sprint.go +++ b/backend/plugins/jira/tasks/apiv2models/sprint.go @@ -37,22 +37,17 @@ type Sprint struct { func (s Sprint) ToToolLayer(connectionId uint64, isServer bool) *models.JiraSprint { sprint := &models.JiraSprint{ - ConnectionId: connectionId, - SprintId: s.ID, - Self: s.Self, - State: s.State, - Name: s.Name, - // StartDate: s.StartDate, + ConnectionId: connectionId, + SprintId: s.ID, + Self: s.Self, + State: s.State, + Name: s.Name, + StartDate: s.StartDate, EndDate: s.EndDate, CompleteDate: s.CompleteDate, OriginBoardID: s.OriginBoardID, } - // jira cloud - if !isServer { - sprint.StartDate = s.StartDate - } - // jira server - if isServer && s.ActivatedDate != nil { + if s.ActivatedDate != nil { sprint.StartDate = s.ActivatedDate } return sprint