This is an automated email from the ASF dual-hosted git repository.
narro pushed a commit to branch 8221-sprint-start-date
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/8221-sprint-start-date by this
push:
new b836bf8e9 fix: start date of sprint is empty
b836bf8e9 is described below
commit b836bf8e9fdbbca2d35bd46b2a7e3d768b8265c6
Author: narro wizard <[email protected]>
AuthorDate: Tue Nov 26 16:11:56 2024 +0800
fix: start date of sprint is empty
[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 +
backend/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 0b1ef8ce8..17509e5f2 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 bdb0a26d2..2abcb57e5 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