Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cherry-pick #7699 fix(zentao): make sure close_date must be before opened_date #7700

Merged
merged 1 commit into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions backend/plugins/zentao/tasks/bug_convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ func ConvertBug(taskCtx plugin.SubTaskContext) errors.Error {
if toolEntity.AssignedToId != 0 {
domainEntity.AssigneeId = accountIdGen.Generate(data.Options.ConnectionId, toolEntity.AssignedToId)
}
if toolEntity.ClosedDate != nil {
temp := uint(toolEntity.ClosedDate.ToNullableTime().Sub(toolEntity.OpenedDate.ToTime()).Minutes())
closedDate := toolEntity.ClosedDate
openedDate := toolEntity.OpenedDate
if closedDate != nil && closedDate.ToTime().After(openedDate.ToTime()) {
temp := uint(closedDate.ToNullableTime().Sub(openedDate.ToTime()).Minutes())
domainEntity.LeadTimeMinutes = &temp
}
var results []interface{}
Expand Down
6 changes: 4 additions & 2 deletions backend/plugins/zentao/tasks/story_convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ func ConvertStory(taskCtx plugin.SubTaskContext) errors.Error {
results = append(results, issueAssignee)
}

if toolEntity.ClosedDate != nil {
temp := uint(toolEntity.ClosedDate.ToNullableTime().Sub(toolEntity.OpenedDate.ToTime()).Minutes())
closedDate := toolEntity.ClosedDate
openedDate := toolEntity.OpenedDate
if closedDate != nil && closedDate.ToTime().After(openedDate.ToTime()) {
temp := uint(closedDate.ToNullableTime().Sub(openedDate.ToTime()).Minutes())
domainEntity.LeadTimeMinutes = &temp
}

Expand Down
6 changes: 4 additions & 2 deletions backend/plugins/zentao/tasks/task_convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ func ConvertTask(taskCtx plugin.SubTaskContext) errors.Error {
if toolEntity.AssignedToId != 0 {
domainEntity.AssigneeId = accountIdGen.Generate(data.Options.ConnectionId, toolEntity.AssignedToId)
}
if toolEntity.ClosedDate != nil {
temp := uint(toolEntity.ClosedDate.ToNullableTime().Sub(toolEntity.OpenedDate.ToTime()).Minutes())
closedDate := toolEntity.ClosedDate
openedDate := toolEntity.OpenedDate
if closedDate != nil && closedDate.ToTime().After(openedDate.ToTime()) {
temp := uint(closedDate.ToNullableTime().Sub(openedDate.ToTime()).Minutes())
domainEntity.LeadTimeMinutes = &temp
}
var results []interface{}
Expand Down
Loading