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

lynwee pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new ab05664ff fix: start date of sprint is empty (#8222)
ab05664ff is described below

commit ab05664ff740af40944d96502706380aeba4dbf2
Author: NaRro <[email protected]>
AuthorDate: Tue Nov 26 16:35:39 2024 +0800

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

Reply via email to