You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by wa...@apache.org on 2022/06/21 12:48:21 UTC

[incubator-devlake] branch main updated (1922ac80 -> 303263ff)

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

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


    from 1922ac80 fix(tapd): ignore err if it's record not found
     new fc36da60 fix: some field is error and fix bugs
     new 303263ff fix: some field is error and fix bugs

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 plugins/tapd/impl/impl.go                          |   3 +-
 plugins/tapd/models/bug.go                         | 126 ++++++-------
 plugins/tapd/models/bug_commit.go                  |  29 ++-
 plugins/tapd/models/iteration.go                   |  34 ++--
 .../tapd/models/migrationscripts/archived/bug.go   | 133 +++++++------
 .../migrationscripts/archived/bug_changelog.go     |   6 +-
 .../models/migrationscripts/archived/bug_commit.go |  33 ++--
 .../migrationscripts/archived/bug_custom_field.go  |   4 +-
 .../models/migrationscripts/archived/bug_label.go  |   6 +-
 .../models/migrationscripts/archived/bug_status.go |   6 +-
 .../models/migrationscripts/archived/iteration.go  |  53 ++----
 .../migrationscripts/archived/iteration_bug.go     |   4 +-
 .../migrationscripts/archived/iteration_task.go    |   4 +-
 .../tapd/models/migrationscripts/archived/story.go |  88 ++++-----
 .../models/migrationscripts/archived/story_bug.go  |   6 +-
 .../migrationscripts/archived/story_category.go    |   4 +-
 .../migrationscripts/archived/story_changelog.go   |   6 +-
 .../migrationscripts/archived/story_commits.go     |  33 ++--
 .../archived/story_custom_field.go                 |   4 +-
 .../migrationscripts/archived/story_label.go       |   6 +-
 .../migrationscripts/archived/story_status.go      |   6 +-
 .../tapd/models/migrationscripts/archived/task.go  |  59 +++---
 .../migrationscripts/archived/task_changelog.go    |   6 +-
 .../migrationscripts/archived/task_commits.go      |  33 ++--
 .../migrationscripts/archived/task_custom_field.go |   4 +-
 .../models/migrationscripts/archived/task_label.go |   6 +-
 .../tapd/models/migrationscripts/archived/user.go  |   6 +-
 .../models/migrationscripts/archived/worklog.go    |  24 +--
 .../models/migrationscripts/archived/workspace.go  |   6 +-
 .../migrationscripts/archived/workspace_bug.go     |   6 +-
 .../migrationscripts/archived/workspace_story.go   |   6 +-
 .../migrationscripts/archived/workspace_task.go    |   6 +-
 plugins/tapd/models/story.go                       | 208 ++++++++++-----------
 plugins/tapd/models/story_commits.go               |  29 ++-
 plugins/tapd/models/task.go                        |  54 +++---
 plugins/tapd/models/task_commits.go                |  29 ++-
 plugins/tapd/models/worklog.go                     |   4 +-
 plugins/tapd/tasks/bug_changelog_collector.go      |   5 +-
 plugins/tapd/tasks/bug_changelog_converter.go      |  31 +--
 plugins/tapd/tasks/bug_changelog_extractor.go      |   1 +
 plugins/tapd/tasks/bug_collector.go                |   7 +-
 plugins/tapd/tasks/bug_commit_collector.go         |  11 +-
 plugins/tapd/tasks/bug_commit_converter.go         |   3 +-
 plugins/tapd/tasks/bug_commit_extractor.go         |   1 +
 plugins/tapd/tasks/bug_converter.go                |   3 +-
 plugins/tapd/tasks/bug_custom_fields_collector.go  |   5 +-
 plugins/tapd/tasks/bug_custom_fields_extractor.go  |   1 +
 plugins/tapd/tasks/bug_extractor.go                |   8 +-
 plugins/tapd/tasks/bug_label_convertor.go          |   6 +-
 plugins/tapd/tasks/bug_status_collector.go         |   3 +-
 plugins/tapd/tasks/bug_status_extractor.go         |   1 +
 plugins/tapd/tasks/company_collector.go            |   5 +-
 plugins/tapd/tasks/company_extractor.go            |   1 +
 plugins/tapd/tasks/iteration_collector.go          |   9 +-
 plugins/tapd/tasks/iteration_converter.go          |  15 +-
 plugins/tapd/tasks/iteration_extractor.go          |   1 +
 plugins/tapd/tasks/shared.go                       |  11 +-
 plugins/tapd/tasks/story_bug_collector.go          |   5 +-
 plugins/tapd/tasks/story_bug_extractor.go          |   1 +
 plugins/tapd/tasks/story_category_collector.go     |   5 +-
 plugins/tapd/tasks/story_category_extractor.go     |   1 +
 plugins/tapd/tasks/story_changelog_collector.go    |   5 +-
 plugins/tapd/tasks/story_changelog_converter.go    |  37 ++--
 plugins/tapd/tasks/story_changelog_extractor.go    |   3 +-
 plugins/tapd/tasks/story_collector.go              |   7 +-
 plugins/tapd/tasks/story_commit_collector.go       |  11 +-
 plugins/tapd/tasks/story_commit_converter.go       |   3 +-
 plugins/tapd/tasks/story_commit_extractor.go       |   1 +
 plugins/tapd/tasks/story_converter.go              |   9 +-
 .../tapd/tasks/story_custom_fields_collector.go    |   5 +-
 .../tapd/tasks/story_custom_fields_extractor.go    |   1 +
 plugins/tapd/tasks/story_extractor.go              |   8 +-
 plugins/tapd/tasks/story_label_convertor.go        |   6 +-
 plugins/tapd/tasks/story_status_collector.go       |   3 +-
 plugins/tapd/tasks/story_status_extractor.go       |   1 +
 plugins/tapd/tasks/task_changelog_collector.go     |   5 +-
 plugins/tapd/tasks/task_changelog_converter.go     |  39 ++--
 plugins/tapd/tasks/task_changelog_extractor.go     |   3 +-
 plugins/tapd/tasks/task_collector.go               |   7 +-
 plugins/tapd/tasks/task_commit_collector.go        |  11 +-
 plugins/tapd/tasks/task_commit_converter.go        |   3 +-
 plugins/tapd/tasks/task_commit_extractor.go        |   1 +
 plugins/tapd/tasks/task_converter.go               |   9 +-
 plugins/tapd/tasks/task_custom_fields_collector.go |   5 +-
 plugins/tapd/tasks/task_custom_fields_extractor.go |   1 +
 plugins/tapd/tasks/task_extractor.go               |   7 +-
 plugins/tapd/tasks/task_label_convertor.go         |   6 +-
 plugins/tapd/tasks/user_collector.go               |   5 +-
 plugins/tapd/tasks/user_converter.go               |   3 +-
 plugins/tapd/tasks/user_extractor.go               |   1 +
 plugins/tapd/tasks/worklog_collector.go            |   7 +-
 plugins/tapd/tasks/worklog_converter.go            |   7 +-
 plugins/tapd/tasks/worklog_extractor.go            |   1 +
 plugins/tapd/tasks/workspace_collector.go          |   5 +-
 plugins/tapd/tasks/workspace_converter.go          |   2 +-
 plugins/tapd/tasks/workspace_extractor.go          |   1 +
 96 files changed, 735 insertions(+), 714 deletions(-)


[incubator-devlake] 01/02: fix: some field is error and fix bugs

Posted by wa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit fc36da6097476d05654d08430815bac5c277949b
Author: abeizn <zi...@merico.dev>
AuthorDate: Tue Jun 21 20:27:30 2022 +0800

    fix: some field is error and fix bugs
---
 plugins/tapd/impl/impl.go                          |   5 +-
 plugins/tapd/models/bug.go                         | 126 ++++++-------
 plugins/tapd/models/bug_commit.go                  |  29 ++-
 plugins/tapd/models/iteration.go                   |  34 ++--
 .../tapd/models/migrationscripts/archived/bug.go   | 129 +++++++------
 .../models/migrationscripts/archived/bug_commit.go |  29 ++-
 .../models/migrationscripts/archived/iteration.go  |  47 ++---
 .../tapd/models/migrationscripts/archived/story.go | 208 ++++++++++-----------
 .../migrationscripts/archived/story_commits.go     |  29 ++-
 .../tapd/models/migrationscripts/archived/task.go  |  54 +++---
 .../migrationscripts/archived/task_commits.go      |  29 ++-
 .../models/migrationscripts/archived/worklog.go    |  20 +-
 plugins/tapd/models/story.go                       | 208 ++++++++++-----------
 plugins/tapd/models/story_commits.go               |  29 ++-
 plugins/tapd/models/task.go                        |  54 +++---
 plugins/tapd/models/task_commits.go                |  29 ++-
 plugins/tapd/models/worklog.go                     |   4 +-
 plugins/tapd/tasks/bug_changelog_collector.go      |   5 +-
 plugins/tapd/tasks/bug_changelog_converter.go      |  31 +--
 plugins/tapd/tasks/bug_changelog_extractor.go      |   1 +
 plugins/tapd/tasks/bug_collector.go                |   7 +-
 plugins/tapd/tasks/bug_commit_collector.go         |  11 +-
 plugins/tapd/tasks/bug_commit_converter.go         |   3 +-
 plugins/tapd/tasks/bug_commit_extractor.go         |   1 +
 plugins/tapd/tasks/bug_converter.go                |   3 +-
 plugins/tapd/tasks/bug_custom_fields_collector.go  |   5 +-
 plugins/tapd/tasks/bug_custom_fields_extractor.go  |   1 +
 plugins/tapd/tasks/bug_extractor.go                |   8 +-
 plugins/tapd/tasks/bug_label_convertor.go          |   6 +-
 plugins/tapd/tasks/bug_status_collector.go         |   3 +-
 plugins/tapd/tasks/bug_status_extractor.go         |   1 +
 plugins/tapd/tasks/company_collector.go            |   5 +-
 plugins/tapd/tasks/company_extractor.go            |   1 +
 plugins/tapd/tasks/iteration_collector.go          |   9 +-
 plugins/tapd/tasks/iteration_converter.go          |  15 +-
 plugins/tapd/tasks/iteration_extractor.go          |   1 +
 plugins/tapd/tasks/shared.go                       |  11 +-
 plugins/tapd/tasks/story_bug_collector.go          |   5 +-
 plugins/tapd/tasks/story_bug_extractor.go          |   1 +
 plugins/tapd/tasks/story_category_collector.go     |   5 +-
 plugins/tapd/tasks/story_category_extractor.go     |   1 +
 plugins/tapd/tasks/story_changelog_collector.go    |   5 +-
 plugins/tapd/tasks/story_changelog_converter.go    |  37 ++--
 plugins/tapd/tasks/story_changelog_extractor.go    |   3 +-
 plugins/tapd/tasks/story_collector.go              |   7 +-
 plugins/tapd/tasks/story_commit_collector.go       |  11 +-
 plugins/tapd/tasks/story_commit_converter.go       |   3 +-
 plugins/tapd/tasks/story_commit_extractor.go       |   1 +
 plugins/tapd/tasks/story_converter.go              |   9 +-
 .../tapd/tasks/story_custom_fields_collector.go    |   5 +-
 .../tapd/tasks/story_custom_fields_extractor.go    |   1 +
 plugins/tapd/tasks/story_extractor.go              |   8 +-
 plugins/tapd/tasks/story_label_convertor.go        |   6 +-
 plugins/tapd/tasks/story_status_collector.go       |   3 +-
 plugins/tapd/tasks/story_status_extractor.go       |   1 +
 plugins/tapd/tasks/task_changelog_collector.go     |   5 +-
 plugins/tapd/tasks/task_changelog_converter.go     |  39 ++--
 plugins/tapd/tasks/task_changelog_extractor.go     |   3 +-
 plugins/tapd/tasks/task_collector.go               |   7 +-
 plugins/tapd/tasks/task_commit_collector.go        |  11 +-
 plugins/tapd/tasks/task_commit_converter.go        |   3 +-
 plugins/tapd/tasks/task_commit_extractor.go        |   1 +
 plugins/tapd/tasks/task_converter.go               |   9 +-
 plugins/tapd/tasks/task_custom_fields_collector.go |   5 +-
 plugins/tapd/tasks/task_custom_fields_extractor.go |   1 +
 plugins/tapd/tasks/task_extractor.go               |   7 +-
 plugins/tapd/tasks/task_label_convertor.go         |   6 +-
 plugins/tapd/tasks/user_collector.go               |   5 +-
 plugins/tapd/tasks/user_converter.go               |   3 +-
 plugins/tapd/tasks/user_extractor.go               |   1 +
 plugins/tapd/tasks/worklog_collector.go            |   7 +-
 plugins/tapd/tasks/worklog_converter.go            |   7 +-
 plugins/tapd/tasks/worklog_extractor.go            |   1 +
 plugins/tapd/tasks/workspace_collector.go          |   5 +-
 plugins/tapd/tasks/workspace_converter.go          |   2 +-
 plugins/tapd/tasks/workspace_extractor.go          |   1 +
 76 files changed, 736 insertions(+), 696 deletions(-)

diff --git a/plugins/tapd/impl/impl.go b/plugins/tapd/impl/impl.go
index 400702ab..d05d0d61 100644
--- a/plugins/tapd/impl/impl.go
+++ b/plugins/tapd/impl/impl.go
@@ -19,9 +19,10 @@ package impl
 
 import (
 	"fmt"
-	"github.com/apache/incubator-devlake/plugins/helper"
 	"time"
 
+	"github.com/apache/incubator-devlake/plugins/helper"
+
 	"github.com/apache/incubator-devlake/migration"
 	"github.com/apache/incubator-devlake/models/domainlayer/didgen"
 	"github.com/apache/incubator-devlake/plugins/core"
@@ -141,7 +142,7 @@ func (plugin Tapd) PrepareTaskData(taskCtx core.TaskContext, options map[string]
 		}
 	}
 	if connection.RateLimit == 0 {
-		connection.RateLimit = 6000
+		connection.RateLimit = 2000
 	}
 	tapdApiClient, err := tasks.NewTapdApiClient(taskCtx, connection)
 	if err != nil {
diff --git a/plugins/tapd/models/bug.go b/plugins/tapd/models/bug.go
index d8292964..bfdf3307 100644
--- a/plugins/tapd/models/bug.go
+++ b/plugins/tapd/models/bug.go
@@ -26,71 +26,71 @@ type TapdBug struct {
 	ConnectionId uint64 `gorm:"primaryKey"`
 	Id           uint64 `gorm:"primaryKey;type:BIGINT" json:"id,string"`
 	EpicKey      string
-	Title        string         `json:"name" gorm:"type:varchar(255)"`
-	Description  string         `json:"description"`
-	WorkspaceId  uint64         `json:"workspace_id,string"`
-	Created      helper.CSTTime `json:"created"`
-	Modified     helper.CSTTime `json:"modified" gorm:"index"`
-	Status       string         `json:"status" gorm:"type:varchar(255)"`
-	Cc           string         `json:"cc" gorm:"type:varchar(255)"`
-	Begin        helper.CSTTime `json:"begin"`
-	Due          helper.CSTTime `json:"due"`
-	Priority     string         `json:"priority" gorm:"type:varchar(255)"`
-	IterationId  uint64         `json:"iteration_id,string"`
-	Source       string         `json:"source" gorm:"type:varchar(255)"`
-	Module       string         `json:"module" gorm:"type:varchar(255)"`
-	ReleaseId    uint64         `json:"release_id,string"`
-	CreatedFrom  string         `json:"created_from" gorm:"type:varchar(255)"`
-	Feature      string         `json:"feature" gorm:"type:varchar(255)"`
+	Title        string          `json:"name" gorm:"type:varchar(255)"`
+	Description  string          `json:"description"`
+	WorkspaceId  uint64          `json:"workspace_id,string"`
+	Created      *helper.CSTTime `json:"created"`
+	Modified     *helper.CSTTime `json:"modified" gorm:"index"`
+	Status       string          `json:"status" gorm:"type:varchar(255)"`
+	Cc           string          `json:"cc" gorm:"type:varchar(255)"`
+	Begin        *helper.CSTTime `json:"begin"`
+	Due          *helper.CSTTime `json:"due"`
+	Priority     string          `json:"priority" gorm:"type:varchar(255)"`
+	IterationId  uint64          `json:"iteration_id,string"`
+	Source       string          `json:"source" gorm:"type:varchar(255)"`
+	Module       string          `json:"module" gorm:"type:varchar(255)"`
+	ReleaseId    uint64          `json:"release_id,string"`
+	CreatedFrom  string          `json:"created_from" gorm:"type:varchar(255)"`
+	Feature      string          `json:"feature" gorm:"type:varchar(255)"`
 	common.NoPKModel
 
-	Severity         string         `json:"severity" gorm:"type:varchar(255)"`
-	Reporter         string         `json:"reporter" gorm:"type:varchar(255)"`
-	Resolved         helper.CSTTime `json:"resolved"`
-	Closed           helper.CSTTime `json:"closed"`
-	Lastmodify       string         `json:"lastmodify" gorm:"type:varchar(255)"`
-	Auditer          string         `json:"auditer" gorm:"type:varchar(255)"`
-	De               string         `json:"De" gorm:"comment:developer;type:varchar(255)"`
-	Fixer            string         `json:"fixer" gorm:"type:varchar(255)"`
-	VersionTest      string         `json:"version_test" gorm:"type:varchar(255)"`
-	VersionReport    string         `json:"version_report" gorm:"type:varchar(255)"`
-	VersionClose     string         `json:"version_close" gorm:"type:varchar(255)"`
-	VersionFix       string         `json:"version_fix" gorm:"type:varchar(255)"`
-	BaselineFind     string         `json:"baseline_find" gorm:"type:varchar(255)"`
-	BaselineJoin     string         `json:"baseline_join" gorm:"type:varchar(255)"`
-	BaselineClose    string         `json:"baseline_close" gorm:"type:varchar(255)"`
-	BaselineTest     string         `json:"baseline_test" gorm:"type:varchar(255)"`
-	Sourcephase      string         `json:"sourcephase" gorm:"type:varchar(255)"`
-	Te               string         `json:"te" gorm:"type:varchar(255)"`
-	CurrentOwner     string         `json:"current_owner" gorm:"type:varchar(255)"`
-	Resolution       string         `json:"resolution" gorm:"type:varchar(255)"`
-	Originphase      string         `json:"originphase" gorm:"type:varchar(255)"`
-	Confirmer        string         `json:"confirmer" gorm:"type:varchar(255)"`
-	Participator     string         `json:"participator" gorm:"type:varchar(255)"`
-	Closer           string         `json:"closer" gorm:"type:varchar(50)"`
-	Platform         string         `json:"platform" gorm:"type:varchar(50)"`
-	Os               string         `json:"os" gorm:"type:varchar(50)"`
-	Testtype         string         `json:"testtype" gorm:"type:varchar(20)"`
-	Testphase        string         `json:"testphase" gorm:"type:varchar(255)"`
-	Frequency        string         `json:"frequency" gorm:"type:varchar(255)"`
-	RegressionNumber string         `json:"regression_number" gorm:"type:varchar(20)"`
-	Flows            string         `json:"flows" gorm:"type:varchar(255)"`
-	Testmode         string         `json:"testmode" gorm:"type:varchar(50)"`
-	IssueId          uint64         `json:"issue_id,string"`
-	VerifyTime       helper.CSTTime `json:"verify_time"`
-	RejectTime       helper.CSTTime `json:"reject_time"`
-	ReopenTime       helper.CSTTime `json:"reopen_time"`
-	AuditTime        helper.CSTTime `json:"audit_time"`
-	SuspendTime      helper.CSTTime `json:"suspend_time"`
-	Deadline         helper.CSTTime `json:"deadline"`
-	InProgressTime   helper.CSTTime `json:"in_progress_time"`
-	AssignedTime     helper.CSTTime `json:"assigned_time"`
-	TemplateId       uint64         `json:"template_id,string"`
-	StoryId          uint64         `json:"story_id,string"`
-	StdStatus        string         `gorm:"type:varchar(20)"`
-	StdType          string         `gorm:"type:varchar(20)"`
-	Type             string         `gorm:"type:varchar(20)"`
-	Url              string         `gorm:"type:varchar(255)"`
+	Severity         string          `json:"severity" gorm:"type:varchar(255)"`
+	Reporter         string          `json:"reporter" gorm:"type:varchar(255)"`
+	Resolved         *helper.CSTTime `json:"resolved"`
+	Closed           *helper.CSTTime `json:"closed"`
+	Lastmodify       string          `json:"lastmodify" gorm:"type:varchar(255)"`
+	Auditer          string          `json:"auditer" gorm:"type:varchar(255)"`
+	De               string          `json:"De" gorm:"comment:developer;type:varchar(255)"`
+	Fixer            string          `json:"fixer" gorm:"type:varchar(255)"`
+	VersionTest      string          `json:"version_test" gorm:"type:varchar(255)"`
+	VersionReport    string          `json:"version_report" gorm:"type:varchar(255)"`
+	VersionClose     string          `json:"version_close" gorm:"type:varchar(255)"`
+	VersionFix       string          `json:"version_fix" gorm:"type:varchar(255)"`
+	BaselineFind     string          `json:"baseline_find" gorm:"type:varchar(255)"`
+	BaselineJoin     string          `json:"baseline_join" gorm:"type:varchar(255)"`
+	BaselineClose    string          `json:"baseline_close" gorm:"type:varchar(255)"`
+	BaselineTest     string          `json:"baseline_test" gorm:"type:varchar(255)"`
+	Sourcephase      string          `json:"sourcephase" gorm:"type:varchar(255)"`
+	Te               string          `json:"te" gorm:"type:varchar(255)"`
+	CurrentOwner     string          `json:"current_owner" gorm:"type:varchar(255)"`
+	Resolution       string          `json:"resolution" gorm:"type:varchar(255)"`
+	Originphase      string          `json:"originphase" gorm:"type:varchar(255)"`
+	Confirmer        string          `json:"confirmer" gorm:"type:varchar(255)"`
+	Participator     string          `json:"participator" gorm:"type:varchar(255)"`
+	Closer           string          `json:"closer" gorm:"type:varchar(50)"`
+	Platform         string          `json:"platform" gorm:"type:varchar(50)"`
+	Os               string          `json:"os" gorm:"type:varchar(50)"`
+	Testtype         string          `json:"testtype" gorm:"type:varchar(20)"`
+	Testphase        string          `json:"testphase" gorm:"type:varchar(255)"`
+	Frequency        string          `json:"frequency" gorm:"type:varchar(255)"`
+	RegressionNumber string          `json:"regression_number" gorm:"type:varchar(20)"`
+	Flows            string          `json:"flows" gorm:"type:varchar(255)"`
+	Testmode         string          `json:"testmode" gorm:"type:varchar(50)"`
+	IssueId          uint64          `json:"issue_id,string"`
+	VerifyTime       *helper.CSTTime `json:"verify_time"`
+	RejectTime       *helper.CSTTime `json:"reject_time"`
+	ReopenTime       *helper.CSTTime `json:"reopen_time"`
+	AuditTime        *helper.CSTTime `json:"audit_time"`
+	SuspendTime      *helper.CSTTime `json:"suspend_time"`
+	Deadline         *helper.CSTTime `json:"deadline"`
+	InProgressTime   *helper.CSTTime `json:"in_progress_time"`
+	AssignedTime     *helper.CSTTime `json:"assigned_time"`
+	TemplateId       uint64          `json:"template_id,string"`
+	StoryId          uint64          `json:"story_id,string"`
+	StdStatus        string          `gorm:"type:varchar(20)"`
+	StdType          string          `gorm:"type:varchar(20)"`
+	Type             string          `gorm:"type:varchar(20)"`
+	Url              string          `gorm:"type:varchar(255)"`
 
 	SupportId       uint64  `json:"support_id,string"`
 	SupportForumId  uint64  `json:"support_forum_id,string"`
diff --git a/plugins/tapd/models/bug_commit.go b/plugins/tapd/models/bug_commit.go
index 6f6632fd..843852c1 100644
--- a/plugins/tapd/models/bug_commit.go
+++ b/plugins/tapd/models/bug_commit.go
@@ -26,21 +26,20 @@ type TapdBugCommit struct {
 	ConnectionId uint64 `gorm:"primaryKey"`
 	Id           uint64 `gorm:"primaryKey;type:BIGINT" json:"id,string"`
 
-	UserId          string `json:"user_id" gorm:"type:varchar(255)"`
-	HookUserName    string `json:"hook_user_name" gorm:"type:varchar(255)"`
-	CommitId        string `json:"commit_id" gorm:"type:varchar(255)"`
-	WorkspaceId     uint64 `json:"workspace_id,string" gorm:"type:BIGINT"`
-	Message         string `json:"message" gorm:"type:text"`
-	Path            string `json:"path" gorm:"type:varchar(255)"`
-	WebURL          string `json:"web_url" gorm:"type:varchar(255)"`
-	HookProjectName string `json:"hook_project_name" gorm:"type:varchar(255)"`
-
-	Ref        string         `json:"ref" gorm:"type:varchar(255)"`
-	RefStatus  string         `json:"ref_status" gorm:"type:varchar(255)"`
-	GitEnv     string         `json:"git_env" gorm:"type:varchar(255)"`
-	FileCommit string         `json:"file_commit"`
-	CommitTime helper.CSTTime `json:"commit_time"`
-	Created    helper.CSTTime `json:"created"`
+	UserId          string          `json:"user_id" gorm:"type:varchar(255)"`
+	HookUserName    string          `json:"hook_user_name" gorm:"type:varchar(255)"`
+	CommitId        string          `json:"commit_id" gorm:"type:varchar(255)"`
+	WorkspaceId     uint64          `json:"workspace_id,string" gorm:"type:BIGINT"`
+	Message         string          `json:"message" gorm:"type:text"`
+	Path            string          `json:"path" gorm:"type:varchar(255)"`
+	WebURL          string          `json:"web_url" gorm:"type:varchar(255)"`
+	HookProjectName string          `json:"hook_project_name" gorm:"type:varchar(255)"`
+	Ref             string          `json:"ref" gorm:"type:varchar(255)"`
+	RefStatus       string          `json:"ref_status" gorm:"type:varchar(255)"`
+	GitEnv          string          `json:"git_env" gorm:"type:varchar(255)"`
+	FileCommit      string          `json:"file_commit"`
+	CommitTime      *helper.CSTTime `json:"commit_time"`
+	Created         *helper.CSTTime `json:"created"`
 
 	BugId uint64
 	common.NoPKModel
diff --git a/plugins/tapd/models/iteration.go b/plugins/tapd/models/iteration.go
index 5e886ae0..32529981 100644
--- a/plugins/tapd/models/iteration.go
+++ b/plugins/tapd/models/iteration.go
@@ -23,23 +23,23 @@ import (
 )
 
 type TapdIteration struct {
-	ConnectionId uint64         `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-	Id           uint64         `gorm:"primaryKey;type:BIGINT  NOT NULL" json:"id,string"`
-	Name         string         `gorm:"type:varchar(255)" json:"name"`
-	WorkspaceId  uint64         `json:"workspace_id,string"`
-	Startdate    helper.CSTTime `json:"startdate"`
-	Enddate      helper.CSTTime `json:"enddate"`
-	Status       string         `gorm:"type:varchar(255)" json:"status"`
-	ReleaseId    uint64         `gorm:"type:BIGINT" json:"release_id,string"`
-	Description  string         `json:"description"`
-	Creator      string         `gorm:"type:varchar(255)" json:"creator"`
-	Created      helper.CSTTime `json:"created"`
-	Modified     helper.CSTTime `json:"modified"`
-	Completed    helper.CSTTime `json:"completed"`
-	Releaseowner string         `gorm:"type:varchar(255)" json:"releaseowner"`
-	Launchdate   helper.CSTTime `json:"launchdate"`
-	Notice       string         `gorm:"type:varchar(255)" json:"notice"`
-	Releasename  string         `gorm:"type:varchar(255)" json:"releasename"`
+	ConnectionId uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL"`
+	Id           uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL" json:"id,string"`
+	Name         string          `gorm:"type:varchar(255)" json:"name"`
+	WorkspaceId  uint64          `json:"workspace_id,string"`
+	Startdate    *helper.CSTTime `json:"startdate"`
+	Enddate      *helper.CSTTime `json:"enddate"`
+	Status       string          `gorm:"type:varchar(255)" json:"status"`
+	ReleaseId    uint64          `gorm:"type:BIGINT" json:"release_id,string"`
+	Description  string          `json:"description"`
+	Creator      string          `gorm:"type:varchar(255)" json:"creator"`
+	Created      *helper.CSTTime `json:"created"`
+	Modified     *helper.CSTTime `json:"modified"`
+	Completed    *helper.CSTTime `json:"completed"`
+	Releaseowner string          `gorm:"type:varchar(255)" json:"releaseowner"`
+	Launchdate   *helper.CSTTime `json:"launchdate"`
+	Notice       string          `gorm:"type:varchar(255)" json:"notice"`
+	Releasename  string          `gorm:"type:varchar(255)" json:"releasename"`
 	common.NoPKModel
 }
 
diff --git a/plugins/tapd/models/migrationscripts/archived/bug.go b/plugins/tapd/models/migrationscripts/archived/bug.go
index e8a817d4..88ee3202 100644
--- a/plugins/tapd/models/migrationscripts/archived/bug.go
+++ b/plugins/tapd/models/migrationscripts/archived/bug.go
@@ -26,71 +26,71 @@ type TapdBug struct {
 	ConnectionId uint64 `gorm:"primaryKey"`
 	Id           uint64 `gorm:"primaryKey;type:BIGINT" json:"id,string"`
 	EpicKey      string
-	Title        string         `json:"name" gorm:"type:varchar(255)"`
-	Description  string         `json:"description"`
-	WorkspaceId  uint64         `json:"workspace_id,string"`
-	Created      helper.CSTTime `json:"created"`
-	Modified     helper.CSTTime `json:"modified" gorm:"index"`
-	Status       string         `json:"status" gorm:"type:varchar(255)"`
-	Cc           string         `json:"cc" gorm:"type:varchar(255)"`
-	Begin        helper.CSTTime `json:"begin"`
-	Due          helper.CSTTime `json:"due"`
-	Priority     string         `json:"priority" gorm:"type:varchar(255)"`
-	IterationId  uint64         `json:"iteration_id,string"`
-	Source       string         `json:"source" gorm:"type:varchar(255)"`
-	Module       string         `json:"module" gorm:"type:varchar(255)"`
-	ReleaseId    uint64         `json:"release_id,string"`
-	CreatedFrom  string         `json:"created_from" gorm:"type:varchar(255)"`
-	Feature      string         `json:"feature" gorm:"type:varchar(255)"`
+	Title        string          `json:"name" gorm:"type:varchar(255)"`
+	Description  string          `json:"description"`
+	WorkspaceId  uint64          `json:"workspace_id,string"`
+	Created      *helper.CSTTime `json:"created"`
+	Modified     *helper.CSTTime `json:"modified" gorm:"index"`
+	Status       string          `json:"status" gorm:"type:varchar(255)"`
+	Cc           string          `json:"cc" gorm:"type:varchar(255)"`
+	Begin        *helper.CSTTime `json:"begin"`
+	Due          *helper.CSTTime `json:"due"`
+	Priority     string          `json:"priority" gorm:"type:varchar(255)"`
+	IterationId  uint64          `json:"iteration_id,string"`
+	Source       string          `json:"source" gorm:"type:varchar(255)"`
+	Module       string          `json:"module" gorm:"type:varchar(255)"`
+	ReleaseId    uint64          `json:"release_id,string"`
+	CreatedFrom  string          `json:"created_from" gorm:"type:varchar(255)"`
+	Feature      string          `json:"feature" gorm:"type:varchar(255)"`
 	common.NoPKModel
 
-	Severity         string         `json:"severity" gorm:"type:varchar(255)"`
-	Reporter         string         `json:"reporter" gorm:"type:varchar(255)"`
-	Resolved         helper.CSTTime `json:"resolved"`
-	Closed           helper.CSTTime `json:"closed"`
-	Lastmodify       string         `json:"lastmodify" gorm:"type:varchar(255)"`
-	Auditer          string         `json:"auditer" gorm:"type:varchar(255)"`
-	De               string         `json:"De" gorm:"comment:developer"`
-	Fixer            string         `json:"fixer" gorm:"type:varchar(255)"`
-	VersionTest      string         `json:"version_test" gorm:"type:varchar(255)"`
-	VersionReport    string         `json:"version_report" gorm:"type:varchar(255)"`
-	VersionClose     string         `json:"version_close" gorm:"type:varchar(255)"`
-	VersionFix       string         `json:"version_fix" gorm:"type:varchar(255)"`
-	BaselineFind     string         `json:"baseline_find" gorm:"type:varchar(255)"`
-	BaselineJoin     string         `json:"baseline_join" gorm:"type:varchar(255)"`
-	BaselineClose    string         `json:"baseline_close" gorm:"type:varchar(255)"`
-	BaselineTest     string         `json:"baseline_test" gorm:"type:varchar(255)"`
-	Sourcephase      string         `json:"sourcephase" gorm:"type:varchar(255)"`
-	Te               string         `json:"te" gorm:"type:varchar(255)"`
-	CurrentOwner     string         `json:"current_owner" gorm:"type:varchar(255)"`
-	Resolution       string         `json:"resolution" gorm:"type:varchar(255)"`
-	Originphase      string         `json:"originphase" gorm:"type:varchar(255)"`
-	Confirmer        string         `json:"confirmer" gorm:"type:varchar(255)"`
-	Participator     string         `json:"participator" gorm:"type:varchar(255)"`
-	Closer           string         `json:"closer" gorm:"type:varchar(50)"`
-	Platform         string         `json:"platform" gorm:"type:varchar(50)"`
-	Os               string         `json:"os" gorm:"type:varchar(50)"`
-	Testtype         string         `json:"testtype" gorm:"type:varchar(20)"`
-	Testphase        string         `json:"testphase" gorm:"type:varchar(255)"`
-	Frequency        string         `json:"frequency" gorm:"type:varchar(255)"`
-	RegressionNumber string         `json:"regression_number" gorm:"type:varchar(20)"`
-	Flows            string         `json:"flows" gorm:"type:varchar(255)"`
-	Testmode         string         `json:"testmode" gorm:"type:varchar(50)"`
-	IssueId          uint64         `json:"issue_id,string"`
-	VerifyTime       helper.CSTTime `json:"verify_time"`
-	RejectTime       helper.CSTTime `json:"reject_time"`
-	ReopenTime       helper.CSTTime `json:"reopen_time"`
-	AuditTime        helper.CSTTime `json:"audit_time"`
-	SuspendTime      helper.CSTTime `json:"suspend_time"`
-	Deadline         helper.CSTTime `json:"deadline"`
-	InProgressTime   helper.CSTTime `json:"in_progress_time"`
-	AssignedTime     helper.CSTTime `json:"assigned_time"`
-	TemplateId       uint64         `json:"template_id,string"`
-	StoryId          uint64         `json:"story_id,string"`
-	StdStatus        string         `gorm:"type:varchar(20)"`
-	StdType          string         `gorm:"type:varchar(20)"`
-	Type             string         `gorm:"type:varchar(20)"`
-	Url              string         `gorm:"type:varchar(255)"`
+	Severity         string          `json:"severity" gorm:"type:varchar(255)"`
+	Reporter         string          `json:"reporter" gorm:"type:varchar(255)"`
+	Resolved         *helper.CSTTime `json:"resolved"`
+	Closed           *helper.CSTTime `json:"closed"`
+	Lastmodify       string          `json:"lastmodify" gorm:"type:varchar(255)"`
+	Auditer          string          `json:"auditer" gorm:"type:varchar(255)"`
+	De               string          `json:"De" gorm:"comment:developer;type:varchar(255)"`
+	Fixer            string          `json:"fixer" gorm:"type:varchar(255)"`
+	VersionTest      string          `json:"version_test" gorm:"type:varchar(255)"`
+	VersionReport    string          `json:"version_report" gorm:"type:varchar(255)"`
+	VersionClose     string          `json:"version_close" gorm:"type:varchar(255)"`
+	VersionFix       string          `json:"version_fix" gorm:"type:varchar(255)"`
+	BaselineFind     string          `json:"baseline_find" gorm:"type:varchar(255)"`
+	BaselineJoin     string          `json:"baseline_join" gorm:"type:varchar(255)"`
+	BaselineClose    string          `json:"baseline_close" gorm:"type:varchar(255)"`
+	BaselineTest     string          `json:"baseline_test" gorm:"type:varchar(255)"`
+	Sourcephase      string          `json:"sourcephase" gorm:"type:varchar(255)"`
+	Te               string          `json:"te" gorm:"type:varchar(255)"`
+	CurrentOwner     string          `json:"current_owner" gorm:"type:varchar(255)"`
+	Resolution       string          `json:"resolution" gorm:"type:varchar(255)"`
+	Originphase      string          `json:"originphase" gorm:"type:varchar(255)"`
+	Confirmer        string          `json:"confirmer" gorm:"type:varchar(255)"`
+	Participator     string          `json:"participator" gorm:"type:varchar(255)"`
+	Closer           string          `json:"closer" gorm:"type:varchar(50)"`
+	Platform         string          `json:"platform" gorm:"type:varchar(50)"`
+	Os               string          `json:"os" gorm:"type:varchar(50)"`
+	Testtype         string          `json:"testtype" gorm:"type:varchar(20)"`
+	Testphase        string          `json:"testphase" gorm:"type:varchar(255)"`
+	Frequency        string          `json:"frequency" gorm:"type:varchar(255)"`
+	RegressionNumber string          `json:"regression_number" gorm:"type:varchar(20)"`
+	Flows            string          `json:"flows" gorm:"type:varchar(255)"`
+	Testmode         string          `json:"testmode" gorm:"type:varchar(50)"`
+	IssueId          uint64          `json:"issue_id,string"`
+	VerifyTime       *helper.CSTTime `json:"verify_time"`
+	RejectTime       *helper.CSTTime `json:"reject_time"`
+	ReopenTime       *helper.CSTTime `json:"reopen_time"`
+	AuditTime        *helper.CSTTime `json:"audit_time"`
+	SuspendTime      *helper.CSTTime `json:"suspend_time"`
+	Deadline         *helper.CSTTime `json:"deadline"`
+	InProgressTime   *helper.CSTTime `json:"in_progress_time"`
+	AssignedTime     *helper.CSTTime `json:"assigned_time"`
+	TemplateId       uint64          `json:"template_id,string"`
+	StoryId          uint64          `json:"story_id,string"`
+	StdStatus        string          `gorm:"type:varchar(20)"`
+	StdType          string          `gorm:"type:varchar(20)"`
+	Type             string          `gorm:"type:varchar(20)"`
+	Url              string          `gorm:"type:varchar(255)"`
 
 	SupportId       uint64  `json:"support_id,string"`
 	SupportForumId  uint64  `json:"support_forum_id,string"`
@@ -104,8 +104,7 @@ type TapdBug struct {
 	Remain          float32 `json:"remain,string"`
 	Progress        string  `json:"progress" gorm:"type:varchar(255)"`
 	Estimate        float32 `json:"estimate,string"`
-
-	Bugtype string `json:"bugtype" gorm:"type:varchar(20)"`
+	Bugtype         string  `json:"bugtype" gorm:"type:varchar(20)"`
 
 	Milestone        string `json:"milestone" gorm:"type:varchar(255)"`
 	CustomFieldOne   string `json:"custom_field_one" gorm:"type:text"`
diff --git a/plugins/tapd/models/migrationscripts/archived/bug_commit.go b/plugins/tapd/models/migrationscripts/archived/bug_commit.go
index 99b32fd6..c3853161 100644
--- a/plugins/tapd/models/migrationscripts/archived/bug_commit.go
+++ b/plugins/tapd/models/migrationscripts/archived/bug_commit.go
@@ -26,21 +26,20 @@ type TapdBugCommit struct {
 	ConnectionId uint64 `gorm:"primaryKey"`
 	Id           uint64 `gorm:"primaryKey;type:BIGINT" json:"id,string"`
 
-	UserId          string `json:"user_id" gorm:"type:varchar(255)"`
-	HookUserName    string `json:"hook_user_name" gorm:"type:varchar(255)"`
-	CommitId        string `json:"commit_id" gorm:"type:varchar(255)"`
-	WorkspaceId     uint64 `json:"workspace_id,string" gorm:"type:BIGINT"`
-	Message         string `json:"message" gorm:"type:text"`
-	Path            string `json:"path" gorm:"type:varchar(255)"`
-	WebURL          string `json:"web_url" gorm:"type:varchar(255)"`
-	HookProjectName string `json:"hook_project_name" gorm:"type:varchar(255)"`
-
-	Ref        string         `json:"ref" gorm:"type:varchar(255)"`
-	RefStatus  string         `json:"ref_status" gorm:"type:varchar(255)"`
-	GitEnv     string         `json:"git_env" gorm:"type:varchar(255)"`
-	FileCommit string         `json:"file_commit"`
-	CommitTime helper.CSTTime `json:"commit_time"`
-	Created    helper.CSTTime `json:"created"`
+	UserId          string          `json:"user_id" gorm:"type:varchar(255)"`
+	HookUserName    string          `json:"hook_user_name" gorm:"type:varchar(255)"`
+	CommitId        string          `json:"commit_id" gorm:"type:varchar(255)"`
+	WorkspaceId     uint64          `json:"workspace_id,string" gorm:"type:BIGINT"`
+	Message         string          `json:"message" gorm:"type:text"`
+	Path            string          `json:"path" gorm:"type:varchar(255)"`
+	WebURL          string          `json:"web_url" gorm:"type:varchar(255)"`
+	HookProjectName string          `json:"hook_project_name" gorm:"type:varchar(255)"`
+	Ref             string          `json:"ref" gorm:"type:varchar(255)"`
+	RefStatus       string          `json:"ref_status" gorm:"type:varchar(255)"`
+	GitEnv          string          `json:"git_env" gorm:"type:varchar(255)"`
+	FileCommit      string          `json:"file_commit"`
+	CommitTime      *helper.CSTTime `json:"commit_time"`
+	Created         *helper.CSTTime `json:"created"`
 
 	BugId uint64
 	common.NoPKModel
diff --git a/plugins/tapd/models/migrationscripts/archived/iteration.go b/plugins/tapd/models/migrationscripts/archived/iteration.go
index 196bc3d8..b9ad33bd 100644
--- a/plugins/tapd/models/migrationscripts/archived/iteration.go
+++ b/plugins/tapd/models/migrationscripts/archived/iteration.go
@@ -23,23 +23,23 @@ import (
 )
 
 type TapdIteration struct {
-	ConnectionId uint64         `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-	Id           uint64         `gorm:"primaryKey;type:BIGINT  NOT NULL" json:"id,string"`
-	Name         string         `gorm:"type:varchar(255)" json:"name"`
-	WorkspaceId  uint64         `json:"workspace_id,string"`
-	Startdate    helper.CSTTime `json:"startdate"`
-	Enddate      helper.CSTTime `json:"enddate"`
-	Status       string         `gorm:"type:varchar(255)" json:"status"`
-	ReleaseId    uint64         `gorm:"type:BIGINT" json:"release_id,string"`
-	Description  string         `json:"description"`
-	Creator      string         `gorm:"type:varchar(255)" json:"creator"`
-	Created      helper.CSTTime `json:"created"`
-	Modified     helper.CSTTime `json:"modified"`
-	Completed    helper.CSTTime `json:"completed"`
-	Releaseowner string         `gorm:"type:varchar(255)" json:"releaseowner"`
-	Launchdate   helper.CSTTime `json:"launchdate"`
-	Notice       string         `gorm:"type:varchar(255)" json:"notice"`
-	Releasename  string         `gorm:"type:varchar(255)" json:"releasename"`
+	ConnectionId uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL"`
+	Id           uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL" json:"id,string"`
+	Name         string          `gorm:"type:varchar(255)" json:"name"`
+	WorkspaceId  uint64          `json:"workspace_id,string"`
+	Startdate    *helper.CSTTime `json:"startdate"`
+	Enddate      *helper.CSTTime `json:"enddate"`
+	Status       string          `gorm:"type:varchar(255)" json:"status"`
+	ReleaseId    uint64          `gorm:"type:BIGINT" json:"release_id,string"`
+	Description  string          `json:"description"`
+	Creator      string          `gorm:"type:varchar(255)" json:"creator"`
+	Created      *helper.CSTTime `json:"created"`
+	Modified     *helper.CSTTime `json:"modified"`
+	Completed    *helper.CSTTime `json:"completed"`
+	Releaseowner string          `gorm:"type:varchar(255)" json:"releaseowner"`
+	Launchdate   *helper.CSTTime `json:"launchdate"`
+	Notice       string          `gorm:"type:varchar(255)" json:"notice"`
+	Releasename  string          `gorm:"type:varchar(255)" json:"releasename"`
 	common.NoPKModel
 }
 
@@ -50,15 +50,6 @@ type TapdWorkspaceIteration struct {
 	IterationId  uint64 `gorm:"primaryKey"`
 }
 
-type TapdIterationIssue struct {
-	common.NoPKModel
-	ConnectionId     uint64 `gorm:"primaryKey"`
-	IterationId      uint64 `gorm:"primaryKey"`
-	IssueId          uint64 `gorm:"primaryKey"`
-	ResolutionDate   helper.CSTTime
-	IssueCreatedDate helper.CSTTime
-}
-
 func (TapdIteration) TableName() string {
 	return "_tool_tapd_iterations"
 }
@@ -66,7 +57,3 @@ func (TapdIteration) TableName() string {
 func (TapdWorkspaceIteration) TableName() string {
 	return "_tool_tapd_workspace_iterations"
 }
-
-func (TapdIterationIssue) TableName() string {
-	return "_tool_tapd_iteration_issues"
-}
diff --git a/plugins/tapd/models/migrationscripts/archived/story.go b/plugins/tapd/models/migrationscripts/archived/story.go
index 1bfe1246..41c7ebc1 100644
--- a/plugins/tapd/models/migrationscripts/archived/story.go
+++ b/plugins/tapd/models/migrationscripts/archived/story.go
@@ -23,110 +23,110 @@ import (
 )
 
 type TapdStory struct {
-	ConnectionId    uint64         `gorm:"primaryKey"`
-	Id              uint64         `gorm:"primaryKey;type:BIGINT" json:"id,string"`
-	WorkitemTypeId  uint64         `json:"workitem_type_id,string"`
-	Name            string         `gorm:"type:varchar(255)" json:"name"`
-	Description     string         `json:"description"`
-	WorkspaceId     uint64         `json:"workspace_id,string"`
-	Creator         string         `gorm:"type:varchar(255)"`
-	Created         helper.CSTTime `json:"created"`
-	Modified        helper.CSTTime `json:"modified" gorm:"index"`
-	Status          string         `json:"status" gorm:"type:varchar(255)"`
-	Owner           string         `json:"owner" gorm:"type:varchar(255)"`
-	Cc              string         `json:"cc" gorm:"type:varchar(255)"`
-	Begin           helper.CSTTime `json:"begin"`
-	Due             helper.CSTTime `json:"due"`
-	Size            int16          `json:"size,string"`
-	Priority        string         `gorm:"type:varchar(255)" json:"priority"`
-	Developer       string         `gorm:"type:varchar(255)" json:"developer"`
-	IterationId     uint64         `json:"iteration_id,string"`
-	TestFocus       string         `json:"test_focus" gorm:"type:varchar(255)"`
-	Type            string         `json:"type" gorm:"type:varchar(20)"`
-	Source          string         `json:"source" gorm:"type:varchar(255)"`
-	Module          string         `json:"module" gorm:"type:varchar(255)"`
-	Version         string         `json:"version" gorm:"type:varchar(255)"`
-	Completed       helper.CSTTime `json:"completed"`
-	CategoryId      int64          `json:"category_id,string"`
-	Path            string         `gorm:"type:varchar(255)" json:"path"`
-	ParentId        uint64         `json:"parent_id,string"`
-	ChildrenId      string         `gorm:"type:text" json:"children_id"`
-	AncestorId      uint64         `json:"ancestor_id,string"`
-	BusinessValue   string         `gorm:"type:varchar(255)" json:"business_value"`
-	Effort          float32        `json:"effort,string"`
-	EffortCompleted float32        `json:"effort_completed,string"`
-	Exceed          float32        `json:"exceed,string"`
-	Remain          float32        `json:"remain,string"`
-	ReleaseId       uint64         `json:"release_id,string"`
-	Confidential    string         `gorm:"type:varchar(255)" json:"confidential"`
-	TemplatedId     uint64         `json:"templated_id,string"`
-	CreatedFrom     string         `gorm:"type:varchar(255)" json:"created_from"`
-	Feature         string         `gorm:"type:varchar(255)" json:"feature"`
-	StdStatus       string         `gorm:"type:varchar(20)"`
-	StdType         string         `gorm:"type:varchar(20)"`
-	Url             string         `gorm:"type:varchar(255)"`
-
-	AttachmentCount  int16  `json:"attachment_count,string"`
-	HasAttachment    string `json:"has_attachment" gorm:"type:varchar(255)"`
-	BugId            uint64 `json:"bug_id,string"`
-	Follower         string `json:"follower" gorm:"type:varchar(255)"`
-	SyncType         string `json:"sync_type" gorm:"type:text"`
-	PredecessorCount int16  `json:"predecessor_count,string"`
-	IsArchived       string `json:"is_archived" gorm:"type:varchar(255)"`
-	Modifier         string `json:"modifier" gorm:"type:varchar(255)"`
-	ProgressManual   string `json:"progress_manual" gorm:"type:varchar(255)"`
-	SuccessorCount   int16  `json:"successor_count,string"`
-	Label            string `json:"label" gorm:"type:varchar(255)"`
-	CustomFieldOne   string `json:"custom_field_one" gorm:"type:text"`
-	CustomFieldTwo   string `json:"custom_field_two" gorm:"type:text"`
-	CustomFieldThree string `json:"custom_field_three" gorm:"type:text"`
-	CustomFieldFour  string `json:"custom_field_four" gorm:"type:text"`
-	CustomFieldFive  string `json:"custom_field_five" gorm:"type:text"`
-	CustomField6     string `json:"custom_field_6" gorm:"type:text"`
-	CustomField7     string `json:"custom_field_7" gorm:"type:text"`
-	CustomField8     string `json:"custom_field_8" gorm:"type:text"`
-	CustomField9     string `json:"custom_field_9" gorm:"type:text"`
-	CustomField10    string `json:"custom_field_10" gorm:"type:text"`
-	CustomField11    string `json:"custom_field_11" gorm:"type:text"`
-	CustomField12    string `json:"custom_field_12" gorm:"type:text"`
-	CustomField13    string `json:"custom_field_13" gorm:"type:text"`
-	CustomField14    string `json:"custom_field_14" gorm:"type:text"`
-	CustomField15    string `json:"custom_field_15" gorm:"type:text"`
-	CustomField16    string `json:"custom_field_16" gorm:"type:text"`
-	CustomField17    string `json:"custom_field_17" gorm:"type:text"`
-	CustomField18    string `json:"custom_field_18" gorm:"type:text"`
-	CustomField19    string `json:"custom_field_19" gorm:"type:text"`
-	CustomField20    string `json:"custom_field_20" gorm:"type:text"`
-	CustomField21    string `json:"custom_field_21" gorm:"type:text"`
-	CustomField22    string `json:"custom_field_22" gorm:"type:text"`
-	CustomField23    string `json:"custom_field_23" gorm:"type:text"`
-	CustomField24    string `json:"custom_field_24" gorm:"type:text"`
-	CustomField25    string `json:"custom_field_25" gorm:"type:text"`
-	CustomField26    string `json:"custom_field_26" gorm:"type:text"`
-	CustomField27    string `json:"custom_field_27" gorm:"type:text"`
-	CustomField28    string `json:"custom_field_28" gorm:"type:text"`
-	CustomField29    string `json:"custom_field_29" gorm:"type:text"`
-	CustomField30    string `json:"custom_field_30" gorm:"type:text"`
-	CustomField31    string `json:"custom_field_31" gorm:"type:text"`
-	CustomField32    string `json:"custom_field_32" gorm:"type:text"`
-	CustomField33    string `json:"custom_field_33" gorm:"type:text"`
-	CustomField34    string `json:"custom_field_34" gorm:"type:text"`
-	CustomField35    string `json:"custom_field_35" gorm:"type:text"`
-	CustomField36    string `json:"custom_field_36" gorm:"type:text"`
-	CustomField37    string `json:"custom_field_37" gorm:"type:text"`
-	CustomField38    string `json:"custom_field_38" gorm:"type:text"`
-	CustomField39    string `json:"custom_field_39" gorm:"type:text"`
-	CustomField40    string `json:"custom_field_40" gorm:"type:text"`
-	CustomField41    string `json:"custom_field_41" gorm:"type:text"`
-	CustomField42    string `json:"custom_field_42" gorm:"type:text"`
-	CustomField43    string `json:"custom_field_43" gorm:"type:text"`
-	CustomField44    string `json:"custom_field_44" gorm:"type:text"`
-	CustomField45    string `json:"custom_field_45" gorm:"type:text"`
-	CustomField46    string `json:"custom_field_46" gorm:"type:text"`
-	CustomField47    string `json:"custom_field_47" gorm:"type:text"`
-	CustomField48    string `json:"custom_field_48" gorm:"type:text"`
-	CustomField49    string `json:"custom_field_49" gorm:"type:text"`
-	CustomField50    string `json:"custom_field_50" gorm:"type:text"`
+	ConnectionId     uint64          `gorm:"primaryKey"`
+	Id               uint64          `gorm:"primaryKey;type:BIGINT" json:"id,string"`
+	WorkitemTypeId   uint64          `json:"workitem_type_id,string"`
+	Name             string          `gorm:"type:varchar(255)" json:"name"`
+	Description      string          `json:"description"`
+	WorkspaceId      uint64          `json:"workspace_id,string"`
+	Creator          string          `gorm:"type:varchar(255)"`
+	Created          *helper.CSTTime `json:"created"`
+	Modified         *helper.CSTTime `json:"modified" gorm:"index"`
+	Status           string          `json:"status" gorm:"type:varchar(255)"`
+	Owner            string          `json:"owner" gorm:"type:varchar(255)"`
+	Cc               string          `json:"cc" gorm:"type:varchar(255)"`
+	Begin            *helper.CSTTime `json:"begin"`
+	Due              *helper.CSTTime `json:"due"`
+	Size             int16           `json:"size,string"`
+	Priority         string          `gorm:"type:varchar(255)" json:"priority"`
+	Developer        string          `gorm:"type:varchar(255)" json:"developer"`
+	IterationId      uint64          `json:"iteration_id,string"`
+	TestFocus        string          `json:"test_focus" gorm:"type:varchar(255)"`
+	Type             string          `json:"type" gorm:"type:varchar(20)"`
+	Source           string          `json:"source" gorm:"type:varchar(255)"`
+	Module           string          `json:"module" gorm:"type:varchar(255)"`
+	Version          string          `json:"version" gorm:"type:varchar(255)"`
+	Completed        *helper.CSTTime `json:"completed"`
+	CategoryId       int64           `json:"category_id,string"`
+	Path             string          `gorm:"type:varchar(255)" json:"path"`
+	ParentId         uint64          `json:"parent_id,string"`
+	ChildrenId       string          `gorm:"type:text" json:"children_id"`
+	AncestorId       uint64          `json:"ancestor_id,string"`
+	BusinessValue    string          `gorm:"type:varchar(255)" json:"business_value"`
+	Effort           float32         `json:"effort,string"`
+	EffortCompleted  float32         `json:"effort_completed,string"`
+	Exceed           float32         `json:"exceed,string"`
+	Remain           float32         `json:"remain,string"`
+	ReleaseId        uint64          `json:"release_id,string"`
+	Confidential     string          `gorm:"type:varchar(255)" json:"confidential"`
+	TemplatedId      uint64          `json:"templated_id,string"`
+	CreatedFrom      string          `gorm:"type:varchar(255)" json:"created_from"`
+	Feature          string          `gorm:"type:varchar(255)" json:"feature"`
+	StdStatus        string          `gorm:"type:varchar(20)"`
+	StdType          string          `gorm:"type:varchar(20)"`
+	Url              string          `gorm:"type:varchar(255)"`
+	
+	AttachmentCount  int16           `json:"attachment_count,string"`
+	HasAttachment    string          `json:"has_attachment" gorm:"type:varchar(255)"`
+	BugId            uint64          `json:"bug_id,string"`
+	Follower         string          `json:"follower" gorm:"type:varchar(255)"`
+	SyncType         string          `json:"sync_type" gorm:"type:text"`
+	PredecessorCount int16           `json:"predecessor_count,string"`
+	IsArchived       string          `json:"is_archived" gorm:"type:varchar(255)"`
+	Modifier         string          `json:"modifier" gorm:"type:varchar(255)"`
+	ProgressManual   string          `json:"progress_manual" gorm:"type:varchar(255)"`
+	SuccessorCount   int16           `json:"successor_count,string"`
+	Label            string          `json:"label" gorm:"type:varchar(255)"`
+	CustomFieldOne   string          `json:"custom_field_one" gorm:"type:text"`
+	CustomFieldTwo   string          `json:"custom_field_two" gorm:"type:text"`
+	CustomFieldThree string          `json:"custom_field_three" gorm:"type:text"`
+	CustomFieldFour  string          `json:"custom_field_four" gorm:"type:text"`
+	CustomFieldFive  string          `json:"custom_field_five" gorm:"type:text"`
+	CustomField6     string          `json:"custom_field_6" gorm:"type:text"`
+	CustomField7     string          `json:"custom_field_7" gorm:"type:text"`
+	CustomField8     string          `json:"custom_field_8" gorm:"type:text"`
+	CustomField9     string          `json:"custom_field_9" gorm:"type:text"`
+	CustomField10    string          `json:"custom_field_10" gorm:"type:text"`
+	CustomField11    string          `json:"custom_field_11" gorm:"type:text"`
+	CustomField12    string          `json:"custom_field_12" gorm:"type:text"`
+	CustomField13    string          `json:"custom_field_13" gorm:"type:text"`
+	CustomField14    string          `json:"custom_field_14" gorm:"type:text"`
+	CustomField15    string          `json:"custom_field_15" gorm:"type:text"`
+	CustomField16    string          `json:"custom_field_16" gorm:"type:text"`
+	CustomField17    string          `json:"custom_field_17" gorm:"type:text"`
+	CustomField18    string          `json:"custom_field_18" gorm:"type:text"`
+	CustomField19    string          `json:"custom_field_19" gorm:"type:text"`
+	CustomField20    string          `json:"custom_field_20" gorm:"type:text"`
+	CustomField21    string          `json:"custom_field_21" gorm:"type:text"`
+	CustomField22    string          `json:"custom_field_22" gorm:"type:text"`
+	CustomField23    string          `json:"custom_field_23" gorm:"type:text"`
+	CustomField24    string          `json:"custom_field_24" gorm:"type:text"`
+	CustomField25    string          `json:"custom_field_25" gorm:"type:text"`
+	CustomField26    string          `json:"custom_field_26" gorm:"type:text"`
+	CustomField27    string          `json:"custom_field_27" gorm:"type:text"`
+	CustomField28    string          `json:"custom_field_28" gorm:"type:text"`
+	CustomField29    string          `json:"custom_field_29" gorm:"type:text"`
+	CustomField30    string          `json:"custom_field_30" gorm:"type:text"`
+	CustomField31    string          `json:"custom_field_31" gorm:"type:text"`
+	CustomField32    string          `json:"custom_field_32" gorm:"type:text"`
+	CustomField33    string          `json:"custom_field_33" gorm:"type:text"`
+	CustomField34    string          `json:"custom_field_34" gorm:"type:text"`
+	CustomField35    string          `json:"custom_field_35" gorm:"type:text"`
+	CustomField36    string          `json:"custom_field_36" gorm:"type:text"`
+	CustomField37    string          `json:"custom_field_37" gorm:"type:text"`
+	CustomField38    string          `json:"custom_field_38" gorm:"type:text"`
+	CustomField39    string          `json:"custom_field_39" gorm:"type:text"`
+	CustomField40    string          `json:"custom_field_40" gorm:"type:text"`
+	CustomField41    string          `json:"custom_field_41" gorm:"type:text"`
+	CustomField42    string          `json:"custom_field_42" gorm:"type:text"`
+	CustomField43    string          `json:"custom_field_43" gorm:"type:text"`
+	CustomField44    string          `json:"custom_field_44" gorm:"type:text"`
+	CustomField45    string          `json:"custom_field_45" gorm:"type:text"`
+	CustomField46    string          `json:"custom_field_46" gorm:"type:text"`
+	CustomField47    string          `json:"custom_field_47" gorm:"type:text"`
+	CustomField48    string          `json:"custom_field_48" gorm:"type:text"`
+	CustomField49    string          `json:"custom_field_49" gorm:"type:text"`
+	CustomField50    string          `json:"custom_field_50" gorm:"type:text"`
 
 	common.NoPKModel
 }
diff --git a/plugins/tapd/models/migrationscripts/archived/story_commits.go b/plugins/tapd/models/migrationscripts/archived/story_commits.go
index 10902165..714747cf 100644
--- a/plugins/tapd/models/migrationscripts/archived/story_commits.go
+++ b/plugins/tapd/models/migrationscripts/archived/story_commits.go
@@ -26,21 +26,20 @@ type TapdStoryCommit struct {
 	ConnectionId uint64 `gorm:"primaryKey"`
 	Id           uint64 `gorm:"primaryKey;type:BIGINT" json:"id,string"`
 
-	UserId          string `json:"user_id" gorm:"type:varchar(255)"`
-	HookUserName    string `json:"hook_user_name" gorm:"type:varchar(255)"`
-	CommitId        string `json:"commit_id" gorm:"type:varchar(255)"`
-	WorkspaceId     uint64 `json:"workspace_id,string" gorm:"type:BIGINT"`
-	Message         string `json:"message" gorm:"type:text"`
-	Path            string `json:"path" gorm:"type:varchar(255)"`
-	WebURL          string `json:"web_url" gorm:"type:varchar(255)"`
-	HookProjectName string `json:"hook_project_name" gorm:"type:varchar(255)"`
-
-	Ref        string         `json:"ref" gorm:"type:varchar(255)"`
-	RefStatus  string         `json:"ref_status" gorm:"type:varchar(255)"`
-	GitEnv     string         `json:"git_env" gorm:"type:varchar(255)"`
-	FileCommit string         `json:"file_commit"`
-	CommitTime helper.CSTTime `json:"commit_time"`
-	Created    helper.CSTTime `json:"created"`
+	UserId          string          `json:"user_id" gorm:"type:varchar(255)"`
+	HookUserName    string          `json:"hook_user_name" gorm:"type:varchar(255)"`
+	CommitId        string          `json:"commit_id" gorm:"type:varchar(255)"`
+	WorkspaceId     uint64          `json:"workspace_id,string" gorm:"type:BIGINT"`
+	Message         string          `json:"message" gorm:"type:text"`
+	Path            string          `json:"path" gorm:"type:varchar(255)"`
+	WebURL          string          `json:"web_url" gorm:"type:varchar(255)"`
+	HookProjectName string          `json:"hook_project_name" gorm:"type:varchar(255)"`
+	Ref             string          `json:"ref" gorm:"type:varchar(255)"`
+	RefStatus       string          `json:"ref_status" gorm:"type:varchar(255)"`
+	GitEnv          string          `json:"git_env" gorm:"type:varchar(255)"`
+	FileCommit      string          `json:"file_commit"`
+	CommitTime      *helper.CSTTime `json:"commit_time"`
+	Created         *helper.CSTTime `json:"created"`
 
 	StoryId uint64
 	common.NoPKModel
diff --git a/plugins/tapd/models/migrationscripts/archived/task.go b/plugins/tapd/models/migrationscripts/archived/task.go
index 62827f74..af0b3339 100644
--- a/plugins/tapd/models/migrationscripts/archived/task.go
+++ b/plugins/tapd/models/migrationscripts/archived/task.go
@@ -23,33 +23,33 @@ import (
 )
 
 type TapdTask struct {
-	ConnectionId    uint64         `gorm:"primaryKey"`
-	Id              uint64         `gorm:"primaryKey;type:BIGINT" json:"id,string"`
-	Name            string         `gorm:"type:varchar(255)" json:"name"`
-	Description     string         `json:"description"`
-	WorkspaceId     uint64         `json:"workspace_id,string"`
-	Creator         string         `gorm:"type:varchar(255)" json:"creator"`
-	Created         helper.CSTTime `json:"created"`
-	Modified        helper.CSTTime `json:"modified" gorm:"index"`
-	Status          string         `json:"status" gorm:"type:varchar(255)"`
-	Owner           string         `json:"owner" gorm:"type:varchar(255)"`
-	Cc              string         `json:"cc" gorm:"type:varchar(255)"`
-	Begin           helper.CSTTime `json:"begin"`
-	Due             helper.CSTTime `json:"due"`
-	Priority        string         `gorm:"type:varchar(255)" json:"priority"`
-	IterationId     uint64         `json:"iteration_id,string"`
-	Completed       helper.CSTTime `json:"completed"`
-	Effort          float32        `json:"effort,string"`
-	EffortCompleted float32        `json:"effort_completed,string"`
-	Exceed          float32        `json:"exceed,string"`
-	Remain          float32        `json:"remain,string"`
-	StdStatus       string         `gorm:"type:varchar(20)"`
-	StdType         string         `gorm:"type:varchar(20)"`
-	Type            string         `gorm:"type:varchar(20)"`
-	StoryId         uint64         `json:"story_id,string"`
-	Progress        int16          `json:"progress,string"`
-	HasAttachment   string         `gorm:"type:varchar(255)"`
-	Url             string         `gorm:"type:varchar(255)"`
+	ConnectionId    uint64          `gorm:"primaryKey"`
+	Id              uint64          `gorm:"primaryKey;type:BIGINT" json:"id,string"`
+	Name            string          `gorm:"type:varchar(255)" json:"name"`
+	Description     string          `json:"description"`
+	WorkspaceId     uint64          `json:"workspace_id,string"`
+	Creator         string          `gorm:"type:varchar(255)" json:"creator"`
+	Created         *helper.CSTTime `json:"created"`
+	Modified        *helper.CSTTime `json:"modified" gorm:"index"`
+	Status          string          `json:"status" gorm:"type:varchar(255)"`
+	Owner           string          `json:"owner" gorm:"type:varchar(255)"`
+	Cc              string          `json:"cc" gorm:"type:varchar(255)"`
+	Begin           *helper.CSTTime `json:"begin"`
+	Due             *helper.CSTTime `json:"due"`
+	Priority        string          `gorm:"type:varchar(255)" json:"priority"`
+	IterationId     uint64          `json:"iteration_id,string"`
+	Completed       *helper.CSTTime `json:"completed"`
+	Effort          float32         `json:"effort,string"`
+	EffortCompleted float32         `json:"effort_completed,string"`
+	Exceed          float32         `json:"exceed,string"`
+	Remain          float32         `json:"remain,string"`
+	StdStatus       string          `gorm:"type:varchar(20)"`
+	StdType         string          `gorm:"type:varchar(20)"`
+	Type            string          `gorm:"type:varchar(20)"`
+	StoryId         uint64          `json:"story_id,string"`
+	Progress        int16           `json:"progress,string"`
+	HasAttachment   string          `gorm:"type:varchar(255)"`
+	Url             string          `gorm:"type:varchar(255)"`
 
 	AttachmentCount  int16  `json:"attachment_count,string"`
 	Follower         string `json:"follower" gorm:"type:varchar(255)"`
diff --git a/plugins/tapd/models/migrationscripts/archived/task_commits.go b/plugins/tapd/models/migrationscripts/archived/task_commits.go
index 4bd89c4e..ec40f345 100644
--- a/plugins/tapd/models/migrationscripts/archived/task_commits.go
+++ b/plugins/tapd/models/migrationscripts/archived/task_commits.go
@@ -26,21 +26,20 @@ type TapdTaskCommit struct {
 	ConnectionId uint64 `gorm:"primaryKey"`
 	Id           uint64 `gorm:"primaryKey;type:BIGINT" json:"id,string"`
 
-	UserId          string `json:"user_id" gorm:"type:varchar(255)"`
-	HookUserName    string `json:"hook_user_name" gorm:"type:varchar(255)"`
-	CommitId        string `json:"commit_id" gorm:"type:varchar(255)"`
-	WorkspaceId     uint64 `json:"workspace_id,string" gorm:"type:BIGINT"`
-	Message         string `json:"message" gorm:"type:text"`
-	Path            string `json:"path" gorm:"type:varchar(255)"`
-	WebURL          string `json:"web_url" gorm:"type:varchar(255)"`
-	HookProjectName string `json:"hook_project_name" gorm:"type:varchar(255)"`
-
-	Ref        string         `json:"ref" gorm:"type:varchar(255)"`
-	RefStatus  string         `json:"ref_status" gorm:"type:varchar(255)"`
-	GitEnv     string         `json:"git_env" gorm:"type:varchar(255)"`
-	FileCommit string         `json:"file_commit"`
-	CommitTime helper.CSTTime `json:"commit_time"`
-	Created    helper.CSTTime `json:"created"`
+	UserId          string          `json:"user_id" gorm:"type:varchar(255)"`
+	HookUserName    string          `json:"hook_user_name" gorm:"type:varchar(255)"`
+	CommitId        string          `json:"commit_id" gorm:"type:varchar(255)"`
+	WorkspaceId     uint64          `json:"workspace_id,string" gorm:"type:BIGINT"`
+	Message         string          `json:"message" gorm:"type:text"`
+	Path            string          `json:"path" gorm:"type:varchar(255)"`
+	WebURL          string          `json:"web_url" gorm:"type:varchar(255)"`
+	HookProjectName string          `json:"hook_project_name" gorm:"type:varchar(255)"`
+	Ref             string          `json:"ref" gorm:"type:varchar(255)"`
+	RefStatus       string          `json:"ref_status" gorm:"type:varchar(255)"`
+	GitEnv          string          `json:"git_env" gorm:"type:varchar(255)"`
+	FileCommit      string          `json:"file_commit"`
+	CommitTime      *helper.CSTTime `json:"commit_time"`
+	Created         *helper.CSTTime `json:"created"`
 
 	TaskId uint64
 	common.NoPKModel
diff --git a/plugins/tapd/models/migrationscripts/archived/worklog.go b/plugins/tapd/models/migrationscripts/archived/worklog.go
index a46821d9..f97ec921 100644
--- a/plugins/tapd/models/migrationscripts/archived/worklog.go
+++ b/plugins/tapd/models/migrationscripts/archived/worklog.go
@@ -23,16 +23,16 @@ import (
 )
 
 type TapdWorklog struct {
-	ConnectionId uint64         `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-	Id           uint64         `gorm:"primaryKey;type:BIGINT  NOT NULL" json:"id,string"`
-	WorkspaceId  uint64         `json:"workspace_id,string"`
-	EntityType   string         `gorm:"type:varchar(255)" json:"entity_type"`
-	EntityId     uint64         `json:"entity_id,string"`
-	Timespent    float32        `json:"timespent,string"`
-	Spentdate    helper.CSTTime `json:"spentdate"`
-	Owner        string         `gorm:"type:varchar(255)" json:"owner"`
-	Created      helper.CSTTime `json:"created"`
-	Memo         string         `json:"memo" gorm:"type:text"`
+	ConnectionId uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL"`
+	Id           uint64          `gorm:"primaryKey;type:BIGINT  NOT NULL" json:"id,string"`
+	WorkspaceId  uint64          `json:"workspace_id,string"`
+	EntityType   string          `gorm:"type:varchar(255)" json:"entity_type"`
+	EntityId     uint64          `json:"entity_id,string"`
+	Timespent    float32         `json:"timespent,string"`
+	Spentdate    *helper.CSTTime `json:"spentdate"`
+	Owner        string          `gorm:"type:varchar(255)" json:"owner"`
+	Created      *helper.CSTTime `json:"created"`
+	Memo         string          `json:"memo" gorm:"type:text"`
 	common.NoPKModel
 }
 
diff --git a/plugins/tapd/models/story.go b/plugins/tapd/models/story.go
index 5363dc15..16264ace 100644
--- a/plugins/tapd/models/story.go
+++ b/plugins/tapd/models/story.go
@@ -23,110 +23,110 @@ import (
 )
 
 type TapdStory struct {
-	ConnectionId    uint64         `gorm:"primaryKey"`
-	Id              uint64         `gorm:"primaryKey;type:BIGINT" json:"id,string"`
-	WorkitemTypeId  uint64         `json:"workitem_type_id,string"`
-	Name            string         `gorm:"type:varchar(255)" json:"name"`
-	Description     string         `json:"description"`
-	WorkspaceId     uint64         `json:"workspace_id,string"`
-	Creator         string         `gorm:"type:varchar(255)"`
-	Created         helper.CSTTime `json:"created"`
-	Modified        helper.CSTTime `json:"modified" gorm:"index"`
-	Status          string         `json:"status" gorm:"type:varchar(255)"`
-	Owner           string         `json:"owner" gorm:"type:varchar(255)"`
-	Cc              string         `json:"cc" gorm:"type:varchar(255)"`
-	Begin           helper.CSTTime `json:"begin"`
-	Due             helper.CSTTime `json:"due"`
-	Size            int16          `json:"size,string"`
-	Priority        string         `gorm:"type:varchar(255)" json:"priority"`
-	Developer       string         `gorm:"type:varchar(255)" json:"developer"`
-	IterationId     uint64         `json:"iteration_id,string"`
-	TestFocus       string         `json:"test_focus" gorm:"type:varchar(255)"`
-	Type            string         `json:"type" gorm:"type:varchar(20)"`
-	Source          string         `json:"source" gorm:"type:varchar(255)"`
-	Module          string         `json:"module" gorm:"type:varchar(255)"`
-	Version         string         `json:"version" gorm:"type:varchar(255)"`
-	Completed       helper.CSTTime `json:"completed"`
-	CategoryId      int64          `json:"category_id,string"`
-	Path            string         `gorm:"type:varchar(255)" json:"path"`
-	ParentId        uint64         `json:"parent_id,string"`
-	ChildrenId      string         `gorm:"type:text" json:"children_id"`
-	AncestorId      uint64         `json:"ancestor_id,string"`
-	BusinessValue   string         `gorm:"type:varchar(255)" json:"business_value"`
-	Effort          float32        `json:"effort,string"`
-	EffortCompleted float32        `json:"effort_completed,string"`
-	Exceed          float32        `json:"exceed,string"`
-	Remain          float32        `json:"remain,string"`
-	ReleaseId       uint64         `json:"release_id,string"`
-	Confidential    string         `gorm:"type:varchar(255)" json:"confidential"`
-	TemplatedId     uint64         `json:"templated_id,string"`
-	CreatedFrom     string         `gorm:"type:varchar(255)" json:"created_from"`
-	Feature         string         `gorm:"type:varchar(255)" json:"feature"`
-	StdStatus       string         `gorm:"type:varchar(20)"`
-	StdType         string         `gorm:"type:varchar(20)"`
-	Url             string         `gorm:"type:varchar(255)"`
-
-	AttachmentCount  int16  `json:"attachment_count,string"`
-	HasAttachment    string `json:"has_attachment" gorm:"type:varchar(255)"`
-	BugId            uint64 `json:"bug_id,string"`
-	Follower         string `json:"follower" gorm:"type:varchar(255)"`
-	SyncType         string `json:"sync_type" gorm:"type:text"`
-	PredecessorCount int16  `json:"predecessor_count,string"`
-	IsArchived       string `json:"is_archived" gorm:"type:varchar(255)"`
-	Modifier         string `json:"modifier" gorm:"type:varchar(255)"`
-	ProgressManual   string `json:"progress_manual" gorm:"type:varchar(255)"`
-	SuccessorCount   int16  `json:"successor_count,string"`
-	Label            string `json:"label" gorm:"type:varchar(255)"`
-	CustomFieldOne   string `json:"custom_field_one" gorm:"type:text"`
-	CustomFieldTwo   string `json:"custom_field_two" gorm:"type:text"`
-	CustomFieldThree string `json:"custom_field_three" gorm:"type:text"`
-	CustomFieldFour  string `json:"custom_field_four" gorm:"type:text"`
-	CustomFieldFive  string `json:"custom_field_five" gorm:"type:text"`
-	CustomField6     string `json:"custom_field_6" gorm:"type:text"`
-	CustomField7     string `json:"custom_field_7" gorm:"type:text"`
-	CustomField8     string `json:"custom_field_8" gorm:"type:text"`
-	CustomField9     string `json:"custom_field_9" gorm:"type:text"`
-	CustomField10    string `json:"custom_field_10" gorm:"type:text"`
-	CustomField11    string `json:"custom_field_11" gorm:"type:text"`
-	CustomField12    string `json:"custom_field_12" gorm:"type:text"`
-	CustomField13    string `json:"custom_field_13" gorm:"type:text"`
-	CustomField14    string `json:"custom_field_14" gorm:"type:text"`
-	CustomField15    string `json:"custom_field_15" gorm:"type:text"`
-	CustomField16    string `json:"custom_field_16" gorm:"type:text"`
-	CustomField17    string `json:"custom_field_17" gorm:"type:text"`
-	CustomField18    string `json:"custom_field_18" gorm:"type:text"`
-	CustomField19    string `json:"custom_field_19" gorm:"type:text"`
-	CustomField20    string `json:"custom_field_20" gorm:"type:text"`
-	CustomField21    string `json:"custom_field_21" gorm:"type:text"`
-	CustomField22    string `json:"custom_field_22" gorm:"type:text"`
-	CustomField23    string `json:"custom_field_23" gorm:"type:text"`
-	CustomField24    string `json:"custom_field_24" gorm:"type:text"`
-	CustomField25    string `json:"custom_field_25" gorm:"type:text"`
-	CustomField26    string `json:"custom_field_26" gorm:"type:text"`
-	CustomField27    string `json:"custom_field_27" gorm:"type:text"`
-	CustomField28    string `json:"custom_field_28" gorm:"type:text"`
-	CustomField29    string `json:"custom_field_29" gorm:"type:text"`
-	CustomField30    string `json:"custom_field_30" gorm:"type:text"`
-	CustomField31    string `json:"custom_field_31" gorm:"type:text"`
-	CustomField32    string `json:"custom_field_32" gorm:"type:text"`
-	CustomField33    string `json:"custom_field_33" gorm:"type:text"`
-	CustomField34    string `json:"custom_field_34" gorm:"type:text"`
-	CustomField35    string `json:"custom_field_35" gorm:"type:text"`
-	CustomField36    string `json:"custom_field_36" gorm:"type:text"`
-	CustomField37    string `json:"custom_field_37" gorm:"type:text"`
-	CustomField38    string `json:"custom_field_38" gorm:"type:text"`
-	CustomField39    string `json:"custom_field_39" gorm:"type:text"`
-	CustomField40    string `json:"custom_field_40" gorm:"type:text"`
-	CustomField41    string `json:"custom_field_41" gorm:"type:text"`
-	CustomField42    string `json:"custom_field_42" gorm:"type:text"`
-	CustomField43    string `json:"custom_field_43" gorm:"type:text"`
-	CustomField44    string `json:"custom_field_44" gorm:"type:text"`
-	CustomField45    string `json:"custom_field_45" gorm:"type:text"`
-	CustomField46    string `json:"custom_field_46" gorm:"type:text"`
-	CustomField47    string `json:"custom_field_47" gorm:"type:text"`
-	CustomField48    string `json:"custom_field_48" gorm:"type:text"`
-	CustomField49    string `json:"custom_field_49" gorm:"type:text"`
-	CustomField50    string `json:"custom_field_50" gorm:"type:text"`
+	ConnectionId     uint64          `gorm:"primaryKey"`
+	Id               uint64          `gorm:"primaryKey;type:BIGINT" json:"id,string"`
+	WorkitemTypeId   uint64          `json:"workitem_type_id,string"`
+	Name             string          `gorm:"type:varchar(255)" json:"name"`
+	Description      string          `json:"description"`
+	WorkspaceId      uint64          `json:"workspace_id,string"`
+	Creator          string          `gorm:"type:varchar(255)"`
+	Created          *helper.CSTTime `json:"created"`
+	Modified         *helper.CSTTime `json:"modified" gorm:"index"`
+	Status           string          `json:"status" gorm:"type:varchar(255)"`
+	Owner            string          `json:"owner" gorm:"type:varchar(255)"`
+	Cc               string          `json:"cc" gorm:"type:varchar(255)"`
+	Begin            *helper.CSTTime `json:"begin"`
+	Due              *helper.CSTTime `json:"due"`
+	Size             int16           `json:"size,string"`
+	Priority         string          `gorm:"type:varchar(255)" json:"priority"`
+	Developer        string          `gorm:"type:varchar(255)" json:"developer"`
+	IterationId      uint64          `json:"iteration_id,string"`
+	TestFocus        string          `json:"test_focus" gorm:"type:varchar(255)"`
+	Type             string          `json:"type" gorm:"type:varchar(20)"`
+	Source           string          `json:"source" gorm:"type:varchar(255)"`
+	Module           string          `json:"module" gorm:"type:varchar(255)"`
+	Version          string          `json:"version" gorm:"type:varchar(255)"`
+	Completed        *helper.CSTTime `json:"completed"`
+	CategoryId       int64           `json:"category_id,string"`
+	Path             string          `gorm:"type:varchar(255)" json:"path"`
+	ParentId         uint64          `json:"parent_id,string"`
+	ChildrenId       string          `gorm:"type:text" json:"children_id"`
+	AncestorId       uint64          `json:"ancestor_id,string"`
+	BusinessValue    string          `gorm:"type:varchar(255)" json:"business_value"`
+	Effort           float32         `json:"effort,string"`
+	EffortCompleted  float32         `json:"effort_completed,string"`
+	Exceed           float32         `json:"exceed,string"`
+	Remain           float32         `json:"remain,string"`
+	ReleaseId        uint64          `json:"release_id,string"`
+	Confidential     string          `gorm:"type:varchar(255)" json:"confidential"`
+	TemplatedId      uint64          `json:"templated_id,string"`
+	CreatedFrom      string          `gorm:"type:varchar(255)" json:"created_from"`
+	Feature          string          `gorm:"type:varchar(255)" json:"feature"`
+	StdStatus        string          `gorm:"type:varchar(20)"`
+	StdType          string          `gorm:"type:varchar(20)"`
+	Url              string          `gorm:"type:varchar(255)"`
+	
+	AttachmentCount  int16           `json:"attachment_count,string"`
+	HasAttachment    string          `json:"has_attachment" gorm:"type:varchar(255)"`
+	BugId            uint64          `json:"bug_id,string"`
+	Follower         string          `json:"follower" gorm:"type:varchar(255)"`
+	SyncType         string          `json:"sync_type" gorm:"type:text"`
+	PredecessorCount int16           `json:"predecessor_count,string"`
+	IsArchived       string          `json:"is_archived" gorm:"type:varchar(255)"`
+	Modifier         string          `json:"modifier" gorm:"type:varchar(255)"`
+	ProgressManual   string          `json:"progress_manual" gorm:"type:varchar(255)"`
+	SuccessorCount   int16           `json:"successor_count,string"`
+	Label            string          `json:"label" gorm:"type:varchar(255)"`
+	CustomFieldOne   string          `json:"custom_field_one" gorm:"type:text"`
+	CustomFieldTwo   string          `json:"custom_field_two" gorm:"type:text"`
+	CustomFieldThree string          `json:"custom_field_three" gorm:"type:text"`
+	CustomFieldFour  string          `json:"custom_field_four" gorm:"type:text"`
+	CustomFieldFive  string          `json:"custom_field_five" gorm:"type:text"`
+	CustomField6     string          `json:"custom_field_6" gorm:"type:text"`
+	CustomField7     string          `json:"custom_field_7" gorm:"type:text"`
+	CustomField8     string          `json:"custom_field_8" gorm:"type:text"`
+	CustomField9     string          `json:"custom_field_9" gorm:"type:text"`
+	CustomField10    string          `json:"custom_field_10" gorm:"type:text"`
+	CustomField11    string          `json:"custom_field_11" gorm:"type:text"`
+	CustomField12    string          `json:"custom_field_12" gorm:"type:text"`
+	CustomField13    string          `json:"custom_field_13" gorm:"type:text"`
+	CustomField14    string          `json:"custom_field_14" gorm:"type:text"`
+	CustomField15    string          `json:"custom_field_15" gorm:"type:text"`
+	CustomField16    string          `json:"custom_field_16" gorm:"type:text"`
+	CustomField17    string          `json:"custom_field_17" gorm:"type:text"`
+	CustomField18    string          `json:"custom_field_18" gorm:"type:text"`
+	CustomField19    string          `json:"custom_field_19" gorm:"type:text"`
+	CustomField20    string          `json:"custom_field_20" gorm:"type:text"`
+	CustomField21    string          `json:"custom_field_21" gorm:"type:text"`
+	CustomField22    string          `json:"custom_field_22" gorm:"type:text"`
+	CustomField23    string          `json:"custom_field_23" gorm:"type:text"`
+	CustomField24    string          `json:"custom_field_24" gorm:"type:text"`
+	CustomField25    string          `json:"custom_field_25" gorm:"type:text"`
+	CustomField26    string          `json:"custom_field_26" gorm:"type:text"`
+	CustomField27    string          `json:"custom_field_27" gorm:"type:text"`
+	CustomField28    string          `json:"custom_field_28" gorm:"type:text"`
+	CustomField29    string          `json:"custom_field_29" gorm:"type:text"`
+	CustomField30    string          `json:"custom_field_30" gorm:"type:text"`
+	CustomField31    string          `json:"custom_field_31" gorm:"type:text"`
+	CustomField32    string          `json:"custom_field_32" gorm:"type:text"`
+	CustomField33    string          `json:"custom_field_33" gorm:"type:text"`
+	CustomField34    string          `json:"custom_field_34" gorm:"type:text"`
+	CustomField35    string          `json:"custom_field_35" gorm:"type:text"`
+	CustomField36    string          `json:"custom_field_36" gorm:"type:text"`
+	CustomField37    string          `json:"custom_field_37" gorm:"type:text"`
+	CustomField38    string          `json:"custom_field_38" gorm:"type:text"`
+	CustomField39    string          `json:"custom_field_39" gorm:"type:text"`
+	CustomField40    string          `json:"custom_field_40" gorm:"type:text"`
+	CustomField41    string          `json:"custom_field_41" gorm:"type:text"`
+	CustomField42    string          `json:"custom_field_42" gorm:"type:text"`
+	CustomField43    string          `json:"custom_field_43" gorm:"type:text"`
+	CustomField44    string          `json:"custom_field_44" gorm:"type:text"`
+	CustomField45    string          `json:"custom_field_45" gorm:"type:text"`
+	CustomField46    string          `json:"custom_field_46" gorm:"type:text"`
+	CustomField47    string          `json:"custom_field_47" gorm:"type:text"`
+	CustomField48    string          `json:"custom_field_48" gorm:"type:text"`
+	CustomField49    string          `json:"custom_field_49" gorm:"type:text"`
+	CustomField50    string          `json:"custom_field_50" gorm:"type:text"`
 
 	common.NoPKModel
 }
diff --git a/plugins/tapd/models/story_commits.go b/plugins/tapd/models/story_commits.go
index ae906f72..f0fdd499 100644
--- a/plugins/tapd/models/story_commits.go
+++ b/plugins/tapd/models/story_commits.go
@@ -26,21 +26,20 @@ type TapdStoryCommit struct {
 	ConnectionId uint64 `gorm:"primaryKey"`
 	Id           uint64 `gorm:"primaryKey;type:BIGINT" json:"id,string"`
 
-	UserId          string `json:"user_id" gorm:"type:varchar(255)"`
-	HookUserName    string `json:"hook_user_name" gorm:"type:varchar(255)"`
-	CommitId        string `json:"commit_id" gorm:"type:varchar(255)"`
-	WorkspaceId     uint64 `json:"workspace_id,string" gorm:"type:BIGINT"`
-	Message         string `json:"message" gorm:"type:text"`
-	Path            string `json:"path" gorm:"type:varchar(255)"`
-	WebURL          string `json:"web_url" gorm:"type:varchar(255)"`
-	HookProjectName string `json:"hook_project_name" gorm:"type:varchar(255)"`
-
-	Ref        string         `json:"ref" gorm:"type:varchar(255)"`
-	RefStatus  string         `json:"ref_status" gorm:"type:varchar(255)"`
-	GitEnv     string         `json:"git_env" gorm:"type:varchar(255)"`
-	FileCommit string         `json:"file_commit"`
-	CommitTime helper.CSTTime `json:"commit_time"`
-	Created    helper.CSTTime `json:"created"`
+	UserId          string          `json:"user_id" gorm:"type:varchar(255)"`
+	HookUserName    string          `json:"hook_user_name" gorm:"type:varchar(255)"`
+	CommitId        string          `json:"commit_id" gorm:"type:varchar(255)"`
+	WorkspaceId     uint64          `json:"workspace_id,string" gorm:"type:BIGINT"`
+	Message         string          `json:"message" gorm:"type:text"`
+	Path            string          `json:"path" gorm:"type:varchar(255)"`
+	WebURL          string          `json:"web_url" gorm:"type:varchar(255)"`
+	HookProjectName string          `json:"hook_project_name" gorm:"type:varchar(255)"`
+	Ref             string          `json:"ref" gorm:"type:varchar(255)"`
+	RefStatus       string          `json:"ref_status" gorm:"type:varchar(255)"`
+	GitEnv          string          `json:"git_env" gorm:"type:varchar(255)"`
+	FileCommit      string          `json:"file_commit"`
+	CommitTime      *helper.CSTTime `json:"commit_time"`
+	Created         *helper.CSTTime `json:"created"`
 
 	StoryId uint64
 	common.NoPKModel
diff --git a/plugins/tapd/models/task.go b/plugins/tapd/models/task.go
index 14bee844..c751a961 100644
--- a/plugins/tapd/models/task.go
+++ b/plugins/tapd/models/task.go
@@ -23,33 +23,33 @@ import (
 )
 
 type TapdTask struct {
-	ConnectionId    uint64         `gorm:"primaryKey"`
-	Id              uint64         `gorm:"primaryKey;type:BIGINT" json:"id,string"`
-	Name            string         `gorm:"type:varchar(255)" json:"name"`
-	Description     string         `json:"description"`
-	WorkspaceId     uint64         `json:"workspace_id,string"`
-	Creator         string         `gorm:"type:varchar(255)" json:"creator"`
-	Created         helper.CSTTime `json:"created"`
-	Modified        helper.CSTTime `json:"modified" gorm:"index"`
-	Status          string         `json:"status" gorm:"type:varchar(255)"`
-	Owner           string         `json:"owner" gorm:"type:varchar(255)"`
-	Cc              string         `json:"cc" gorm:"type:varchar(255)"`
-	Begin           helper.CSTTime `json:"begin"`
-	Due             helper.CSTTime `json:"due"`
-	Priority        string         `gorm:"type:varchar(255)" json:"priority"`
-	IterationId     uint64         `json:"iteration_id,string"`
-	Completed       helper.CSTTime `json:"completed"`
-	Effort          float32        `json:"effort,string"`
-	EffortCompleted float32        `json:"effort_completed,string"`
-	Exceed          float32        `json:"exceed,string"`
-	Remain          float32        `json:"remain,string"`
-	StdStatus       string         `gorm:"type:varchar(20)"`
-	StdType         string         `gorm:"type:varchar(20)"`
-	Type            string         `gorm:"type:varchar(20)"`
-	StoryId         uint64         `json:"story_id,string"`
-	Progress        int16          `json:"progress,string"`
-	HasAttachment   string         `gorm:"type:varchar(255)"`
-	Url             string         `gorm:"type:varchar(255)"`
+	ConnectionId    uint64          `gorm:"primaryKey"`
+	Id              uint64          `gorm:"primaryKey;type:BIGINT" json:"id,string"`
+	Name            string          `gorm:"type:varchar(255)" json:"name"`
+	Description     string          `json:"description"`
+	WorkspaceId     uint64          `json:"workspace_id,string"`
+	Creator         string          `gorm:"type:varchar(255)" json:"creator"`
+	Created         *helper.CSTTime `json:"created"`
+	Modified        *helper.CSTTime `json:"modified" gorm:"index"`
+	Status          string          `json:"status" gorm:"type:varchar(255)"`
+	Owner           string          `json:"owner" gorm:"type:varchar(255)"`
+	Cc              string          `json:"cc" gorm:"type:varchar(255)"`
+	Begin           *helper.CSTTime `json:"begin"`
+	Due             *helper.CSTTime `json:"due"`
+	Priority        string          `gorm:"type:varchar(255)" json:"priority"`
+	IterationId     uint64          `json:"iteration_id,string"`
+	Completed       *helper.CSTTime `json:"completed"`
+	Effort          float32         `json:"effort,string"`
+	EffortCompleted float32         `json:"effort_completed,string"`
+	Exceed          float32         `json:"exceed,string"`
+	Remain          float32         `json:"remain,string"`
+	StdStatus       string          `gorm:"type:varchar(20)"`
+	StdType         string          `gorm:"type:varchar(20)"`
+	Type            string          `gorm:"type:varchar(20)"`
+	StoryId         uint64          `json:"story_id,string"`
+	Progress        int16           `json:"progress,string"`
+	HasAttachment   string          `gorm:"type:varchar(255)"`
+	Url             string          `gorm:"type:varchar(255)"`
 
 	AttachmentCount  int16  `json:"attachment_count,string"`
 	Follower         string `json:"follower" gorm:"type:varchar(255)"`
diff --git a/plugins/tapd/models/task_commits.go b/plugins/tapd/models/task_commits.go
index 873dd6b9..c505613a 100644
--- a/plugins/tapd/models/task_commits.go
+++ b/plugins/tapd/models/task_commits.go
@@ -26,21 +26,20 @@ type TapdTaskCommit struct {
 	ConnectionId uint64 `gorm:"primaryKey"`
 	Id           uint64 `gorm:"primaryKey;type:BIGINT" json:"id,string"`
 
-	UserId          string `json:"user_id" gorm:"type:varchar(255)"`
-	HookUserName    string `json:"hook_user_name" gorm:"type:varchar(255)"`
-	CommitId        string `json:"commit_id" gorm:"type:varchar(255)"`
-	WorkspaceId     uint64 `json:"workspace_id,string" gorm:"type:BIGINT"`
-	Message         string `json:"message" gorm:"type:text"`
-	Path            string `json:"path" gorm:"type:varchar(255)"`
-	WebURL          string `json:"web_url" gorm:"type:varchar(255)"`
-	HookProjectName string `json:"hook_project_name" gorm:"type:varchar(255)"`
-
-	Ref        string         `json:"ref" gorm:"type:varchar(255)"`
-	RefStatus  string         `json:"ref_status" gorm:"type:varchar(255)"`
-	GitEnv     string         `json:"git_env" gorm:"type:varchar(255)"`
-	FileCommit string         `json:"file_commit"`
-	CommitTime helper.CSTTime `json:"commit_time"`
-	Created    helper.CSTTime `json:"created"`
+	UserId          string          `json:"user_id" gorm:"type:varchar(255)"`
+	HookUserName    string          `json:"hook_user_name" gorm:"type:varchar(255)"`
+	CommitId        string          `json:"commit_id" gorm:"type:varchar(255)"`
+	WorkspaceId     uint64          `json:"workspace_id,string" gorm:"type:BIGINT"`
+	Message         string          `json:"message" gorm:"type:text"`
+	Path            string          `json:"path" gorm:"type:varchar(255)"`
+	WebURL          string          `json:"web_url" gorm:"type:varchar(255)"`
+	HookProjectName string          `json:"hook_project_name" gorm:"type:varchar(255)"`
+	Ref             string          `json:"ref" gorm:"type:varchar(255)"`
+	RefStatus       string          `json:"ref_status" gorm:"type:varchar(255)"`
+	GitEnv          string          `json:"git_env" gorm:"type:varchar(255)"`
+	FileCommit      string          `json:"file_commit"`
+	CommitTime      *helper.CSTTime `json:"commit_time"`
+	Created         *helper.CSTTime `json:"created"`
 
 	TaskId uint64
 	common.NoPKModel
diff --git a/plugins/tapd/models/worklog.go b/plugins/tapd/models/worklog.go
index b602bfc2..ff9bb963 100644
--- a/plugins/tapd/models/worklog.go
+++ b/plugins/tapd/models/worklog.go
@@ -29,9 +29,9 @@ type TapdWorklog struct {
 	EntityType   string         `gorm:"type:varchar(255)" json:"entity_type"`
 	EntityId     uint64         `json:"entity_id,string"`
 	Timespent    float32        `json:"timespent,string"`
-	Spentdate    helper.CSTTime `json:"spentdate"`
+	Spentdate    *helper.CSTTime `json:"spentdate"`
 	Owner        string         `gorm:"type:varchar(255)" json:"owner"`
-	Created      helper.CSTTime `json:"created"`
+	Created      *helper.CSTTime `json:"created"`
 	Memo         string         `json:"memo" gorm:"type:text"`
 	common.NoPKModel
 }
diff --git a/plugins/tapd/tasks/bug_changelog_collector.go b/plugins/tapd/tasks/bug_changelog_collector.go
index 39b931ff..372ef30e 100644
--- a/plugins/tapd/tasks/bug_changelog_collector.go
+++ b/plugins/tapd/tasks/bug_changelog_collector.go
@@ -19,12 +19,13 @@ package tasks
 
 import (
 	"fmt"
+	"net/url"
+	"time"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"net/url"
-	"time"
 )
 
 const RAW_BUG_CHANGELOG_TABLE = "tapd_api_bug_changelogs"
diff --git a/plugins/tapd/tasks/bug_changelog_converter.go b/plugins/tapd/tasks/bug_changelog_converter.go
index 60d864d8..34727efd 100644
--- a/plugins/tapd/tasks/bug_changelog_converter.go
+++ b/plugins/tapd/tasks/bug_changelog_converter.go
@@ -18,10 +18,11 @@ limitations under the License.
 package tasks
 
 import (
-	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"reflect"
 	"time"
 
+	"github.com/apache/incubator-devlake/plugins/core/dal"
+
 	"github.com/apache/incubator-devlake/models/common"
 	"github.com/apache/incubator-devlake/models/domainlayer"
 	"github.com/apache/incubator-devlake/models/domainlayer/didgen"
@@ -32,19 +33,19 @@ import (
 )
 
 type BugChangelogItemResult struct {
-	ConnectionId      uint64    `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-	WorkspaceId       uint64    `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-	Id                uint64    `gorm:"primaryKey;type:BIGINT  NOT NULL" json:"id"`
-	BugId             uint64    `json:"bug_id"`
-	Author            string    `json:"author" gorm:"type:varchar(255)"`
-	Field             string    `json:"field"`
-	OldValue          string    `json:"old_value"`
-	NewValue          string    `json:"new_value"`
-	Memo              string    `json:"memo"`
-	Created           time.Time `json:"created"`
-	ChangelogId       uint64    `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-	ValueBeforeParsed string    `json:"value_before"`
-	ValueAfterParsed  string    `json:"value_after"`
+	ConnectionId      uint64     `gorm:"primaryKey;type:BIGINT  NOT NULL"`
+	WorkspaceId       uint64     `gorm:"primaryKey;type:BIGINT  NOT NULL"`
+	Id                uint64     `gorm:"primaryKey;type:BIGINT  NOT NULL" json:"id"`
+	BugId             uint64     `json:"bug_id"`
+	Author            string     `json:"author" gorm:"type:varchar(255)"`
+	Field             string     `json:"field"`
+	OldValue          string     `json:"old_value"`
+	NewValue          string     `json:"new_value"`
+	Memo              string     `json:"memo"`
+	Created           *time.Time `json:"created"`
+	ChangelogId       uint64     `gorm:"primaryKey;type:BIGINT  NOT NULL"`
+	ValueBeforeParsed string     `json:"value_before"`
+	ValueAfterParsed  string     `json:"value_after"`
 	IterationIdFrom   uint64
 	IterationIdTo     uint64
 	common.NoPKModel
@@ -87,7 +88,7 @@ func ConvertBugChangelog(taskCtx core.SubTaskContext) error {
 				FieldName:         cl.Field,
 				OriginalFromValue: cl.ValueBeforeParsed,
 				OriginalToValue:   cl.ValueAfterParsed,
-				CreatedDate:       cl.Created,
+				CreatedDate:       *cl.Created,
 			}
 
 			return []interface{}{
diff --git a/plugins/tapd/tasks/bug_changelog_extractor.go b/plugins/tapd/tasks/bug_changelog_extractor.go
index 437c0244..380f818c 100644
--- a/plugins/tapd/tasks/bug_changelog_extractor.go
+++ b/plugins/tapd/tasks/bug_changelog_extractor.go
@@ -19,6 +19,7 @@ package tasks
 
 import (
 	"encoding/json"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
diff --git a/plugins/tapd/tasks/bug_collector.go b/plugins/tapd/tasks/bug_collector.go
index 1ffcf120..67d0701c 100644
--- a/plugins/tapd/tasks/bug_collector.go
+++ b/plugins/tapd/tasks/bug_collector.go
@@ -19,12 +19,13 @@ package tasks
 
 import (
 	"fmt"
+	"net/url"
+	"time"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"net/url"
-	"time"
 )
 
 const RAW_BUG_TABLE = "tapd_api_bugs"
@@ -51,7 +52,7 @@ func CollectBugs(taskCtx core.SubTaskContext) error {
 			return fmt.Errorf("failed to get latest tapd changelog record: %w", err)
 		}
 		if latestUpdated.Id > 0 {
-			since = (*time.Time)(&latestUpdated.Modified)
+			since = (*time.Time)(latestUpdated.Modified)
 			incremental = true
 		}
 	}
diff --git a/plugins/tapd/tasks/bug_commit_collector.go b/plugins/tapd/tasks/bug_commit_collector.go
index 9729c6ab..c64688b1 100644
--- a/plugins/tapd/tasks/bug_commit_collector.go
+++ b/plugins/tapd/tasks/bug_commit_collector.go
@@ -20,14 +20,15 @@ package tasks
 import (
 	"encoding/json"
 	"fmt"
-	"github.com/apache/incubator-devlake/plugins/core"
-	"github.com/apache/incubator-devlake/plugins/core/dal"
-	"github.com/apache/incubator-devlake/plugins/helper"
-	"github.com/apache/incubator-devlake/plugins/tapd/models"
 	"net/http"
 	"net/url"
 	"reflect"
 	"time"
+
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/core/dal"
+	"github.com/apache/incubator-devlake/plugins/helper"
+	"github.com/apache/incubator-devlake/plugins/tapd/models"
 )
 
 const RAW_BUG_COMMIT_TABLE = "tapd_api_bug_commits"
@@ -58,7 +59,7 @@ func CollectBugCommits(taskCtx core.SubTaskContext) error {
 			return fmt.Errorf("failed to get latest tapd changelog record: %w", err)
 		}
 		if latestUpdated.Id > 0 {
-			since = (*time.Time)(&latestUpdated.Created)
+			since = (*time.Time)(latestUpdated.Created)
 			incremental = true
 		}
 	}
diff --git a/plugins/tapd/tasks/bug_commit_converter.go b/plugins/tapd/tasks/bug_commit_converter.go
index fd5e7c37..5c3e5626 100644
--- a/plugins/tapd/tasks/bug_commit_converter.go
+++ b/plugins/tapd/tasks/bug_commit_converter.go
@@ -18,12 +18,13 @@ limitations under the License.
 package tasks
 
 import (
+	"reflect"
+
 	"github.com/apache/incubator-devlake/models/domainlayer/crossdomain"
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"reflect"
 )
 
 func ConvertBugCommit(taskCtx core.SubTaskContext) error {
diff --git a/plugins/tapd/tasks/bug_commit_extractor.go b/plugins/tapd/tasks/bug_commit_extractor.go
index a1a77176..6266b9ea 100644
--- a/plugins/tapd/tasks/bug_commit_extractor.go
+++ b/plugins/tapd/tasks/bug_commit_extractor.go
@@ -19,6 +19,7 @@ package tasks
 
 import (
 	"encoding/json"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
diff --git a/plugins/tapd/tasks/bug_converter.go b/plugins/tapd/tasks/bug_converter.go
index 3f35059b..deeea019 100644
--- a/plugins/tapd/tasks/bug_converter.go
+++ b/plugins/tapd/tasks/bug_converter.go
@@ -18,10 +18,11 @@ limitations under the License.
 package tasks
 
 import (
-	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"reflect"
 	"strconv"
 
+	"github.com/apache/incubator-devlake/plugins/core/dal"
+
 	"github.com/apache/incubator-devlake/models/domainlayer"
 	"github.com/apache/incubator-devlake/models/domainlayer/ticket"
 	"github.com/apache/incubator-devlake/plugins/core"
diff --git a/plugins/tapd/tasks/bug_custom_fields_collector.go b/plugins/tapd/tasks/bug_custom_fields_collector.go
index 59b92e09..df1136e0 100644
--- a/plugins/tapd/tasks/bug_custom_fields_collector.go
+++ b/plugins/tapd/tasks/bug_custom_fields_collector.go
@@ -20,10 +20,11 @@ package tasks
 import (
 	"encoding/json"
 	"fmt"
-	"github.com/apache/incubator-devlake/plugins/core"
-	"github.com/apache/incubator-devlake/plugins/helper"
 	"net/http"
 	"net/url"
+
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
 const RAW_BUG_CUSTOM_FIELDS_TABLE = "tapd_api_bug_custom_fields"
diff --git a/plugins/tapd/tasks/bug_custom_fields_extractor.go b/plugins/tapd/tasks/bug_custom_fields_extractor.go
index 25d3d6c3..6cd6d442 100644
--- a/plugins/tapd/tasks/bug_custom_fields_extractor.go
+++ b/plugins/tapd/tasks/bug_custom_fields_extractor.go
@@ -19,6 +19,7 @@ package tasks
 
 import (
 	"encoding/json"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
diff --git a/plugins/tapd/tasks/bug_extractor.go b/plugins/tapd/tasks/bug_extractor.go
index 948182e2..927aa75c 100644
--- a/plugins/tapd/tasks/bug_extractor.go
+++ b/plugins/tapd/tasks/bug_extractor.go
@@ -20,12 +20,13 @@ package tasks
 import (
 	"encoding/json"
 	"fmt"
+	"strings"
+
 	"github.com/apache/incubator-devlake/models/domainlayer/ticket"
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"strings"
 )
 
 var _ core.SubTaskEntryPoint = ExtractBugs
@@ -43,7 +44,6 @@ func ExtractBugs(taskCtx core.SubTaskContext) error {
 	statusList := make([]*models.TapdBugStatus, 0)
 	clauses := []dal.Clause{
 		dal.Where("connection_id = ? and workspace_id = ?", data.Options.ConnectionId, data.Options.WorkspaceId),
-		dal.Orderby("created DESC"),
 	}
 	err := db.All(&statusList, clauses...)
 	if err != nil {
@@ -99,8 +99,8 @@ func ExtractBugs(taskCtx core.SubTaskContext) error {
 					IterationId:    toolL.IterationId,
 					WorkspaceId:    toolL.WorkspaceId,
 					BugId:          toolL.Id,
-					ResolutionDate: toolL.Resolved,
-					BugCreatedDate: toolL.Created,
+					ResolutionDate: *toolL.Resolved,
+					BugCreatedDate: *toolL.Created,
 				}
 				results = append(results, iterationBug)
 			}
diff --git a/plugins/tapd/tasks/bug_label_convertor.go b/plugins/tapd/tasks/bug_label_convertor.go
index dbb56c30..6c43069f 100644
--- a/plugins/tapd/tasks/bug_label_convertor.go
+++ b/plugins/tapd/tasks/bug_label_convertor.go
@@ -18,9 +18,10 @@ limitations under the License.
 package tasks
 
 import (
+	"reflect"
+
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"reflect"
 
 	"github.com/apache/incubator-devlake/models/domainlayer/ticket"
 	"github.com/apache/incubator-devlake/plugins/core"
@@ -38,7 +39,8 @@ func ConvertBugLabels(taskCtx core.SubTaskContext) error {
 	db := taskCtx.GetDal()
 	rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx, RAW_BUG_TABLE)
 	clauses := []dal.Clause{
-		dal.Join(`left join _tool_tapd_workspace_bugs on _tool_tapd_workspace_bugs.bug_id = _tool_tapd_bug_labels.bug_id`),
+		dal.From(&models.TapdBugLabel{}),
+		dal.Join("left join _tool_tapd_workspace_bugs on _tool_tapd_workspace_bugs.bug_id = _tool_tapd_bug_labels.bug_id"),
 		dal.Where("_tool_tapd_workspace_bugs.workspace_id = ? and _tool_tapd_workspace_bugs.connection_id = ?",
 			data.Options.WorkspaceId, data.Options.ConnectionId),
 		dal.Orderby("bug_id ASC"),
diff --git a/plugins/tapd/tasks/bug_status_collector.go b/plugins/tapd/tasks/bug_status_collector.go
index 02ef9134..178b8e4f 100644
--- a/plugins/tapd/tasks/bug_status_collector.go
+++ b/plugins/tapd/tasks/bug_status_collector.go
@@ -19,9 +19,10 @@ package tasks
 
 import (
 	"fmt"
+	"net/url"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
-	"net/url"
 )
 
 const RAW_BUG_STATUS_TABLE = "tapd_api_bug_status"
diff --git a/plugins/tapd/tasks/bug_status_extractor.go b/plugins/tapd/tasks/bug_status_extractor.go
index a01a43e3..60fedb2b 100644
--- a/plugins/tapd/tasks/bug_status_extractor.go
+++ b/plugins/tapd/tasks/bug_status_extractor.go
@@ -19,6 +19,7 @@ package tasks
 
 import (
 	"encoding/json"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
diff --git a/plugins/tapd/tasks/company_collector.go b/plugins/tapd/tasks/company_collector.go
index 7b37c6c0..598eb33b 100644
--- a/plugins/tapd/tasks/company_collector.go
+++ b/plugins/tapd/tasks/company_collector.go
@@ -20,10 +20,11 @@ package tasks
 import (
 	"encoding/json"
 	"fmt"
-	"github.com/apache/incubator-devlake/plugins/core"
-	"github.com/apache/incubator-devlake/plugins/helper"
 	"net/http"
 	"net/url"
+
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
 const RAW_COMPANY_TABLE = "tapd_api_companies"
diff --git a/plugins/tapd/tasks/company_extractor.go b/plugins/tapd/tasks/company_extractor.go
index c045d4ea..71887ad0 100644
--- a/plugins/tapd/tasks/company_extractor.go
+++ b/plugins/tapd/tasks/company_extractor.go
@@ -19,6 +19,7 @@ package tasks
 
 import (
 	"encoding/json"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 )
diff --git a/plugins/tapd/tasks/iteration_collector.go b/plugins/tapd/tasks/iteration_collector.go
index f2cf99dc..6f4139be 100644
--- a/plugins/tapd/tasks/iteration_collector.go
+++ b/plugins/tapd/tasks/iteration_collector.go
@@ -20,13 +20,14 @@ package tasks
 import (
 	"encoding/json"
 	"fmt"
+	"net/http"
+	"net/url"
+	"time"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"net/http"
-	"net/url"
-	"time"
 )
 
 const RAW_ITERATION_TABLE = "tapd_api_iterations"
@@ -52,7 +53,7 @@ func CollectIterations(taskCtx core.SubTaskContext) error {
 			return fmt.Errorf("failed to get latest tapd changelog record: %w", err)
 		}
 		if latestUpdated.Id > 0 {
-			since = (*time.Time)(&latestUpdated.Modified)
+			since = (*time.Time)(latestUpdated.Modified)
 			incremental = true
 		}
 	}
diff --git a/plugins/tapd/tasks/iteration_converter.go b/plugins/tapd/tasks/iteration_converter.go
index 8168d758..dae91df5 100644
--- a/plugins/tapd/tasks/iteration_converter.go
+++ b/plugins/tapd/tasks/iteration_converter.go
@@ -19,6 +19,10 @@ package tasks
 
 import (
 	"fmt"
+	"reflect"
+	"strings"
+	"time"
+
 	"github.com/apache/incubator-devlake/models/domainlayer"
 	"github.com/apache/incubator-devlake/models/domainlayer/didgen"
 	"github.com/apache/incubator-devlake/models/domainlayer/ticket"
@@ -26,9 +30,6 @@ import (
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"reflect"
-	"strings"
-	"time"
 )
 
 func ConvertIteration(taskCtx core.SubTaskContext) error {
@@ -39,7 +40,7 @@ func ConvertIteration(taskCtx core.SubTaskContext) error {
 	iterIdGen := didgen.NewDomainIdGenerator(&models.TapdIteration{})
 	clauses := []dal.Clause{
 		dal.From(&models.TapdIteration{}),
-		dal.Where("tc.connection_id = ? AND tc.workspace_id = ?", data.Connection.ID, data.Options.WorkspaceId),
+		dal.Where("connection_id = ? AND workspace_id = ?", data.Connection.ID, data.Options.WorkspaceId),
 	}
 
 	cursor, err := db.Cursor(clauses...)
@@ -58,10 +59,10 @@ func ConvertIteration(taskCtx core.SubTaskContext) error {
 				Url:             fmt.Sprintf("https://www.tapd.cn/%d/prong/iterations/view/%d", iter.WorkspaceId, iter.Id),
 				Status:          strings.ToUpper(iter.Status),
 				Name:            iter.Name,
-				StartedDate:     (*time.Time)(&iter.Startdate),
-				EndedDate:       (*time.Time)(&iter.Enddate),
+				StartedDate:     (*time.Time)(iter.Startdate),
+				EndedDate:       (*time.Time)(iter.Enddate),
 				OriginalBoardID: WorkspaceIdGen.Generate(iter.ConnectionId, iter.WorkspaceId),
-				CompletedDate:   (*time.Time)(&iter.Completed),
+				CompletedDate:   (*time.Time)(iter.Completed),
 			}
 			results := make([]interface{}, 0)
 			results = append(results, domainIter)
diff --git a/plugins/tapd/tasks/iteration_extractor.go b/plugins/tapd/tasks/iteration_extractor.go
index b5dfd893..3678d802 100644
--- a/plugins/tapd/tasks/iteration_extractor.go
+++ b/plugins/tapd/tasks/iteration_extractor.go
@@ -19,6 +19,7 @@ package tasks
 
 import (
 	"encoding/json"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
diff --git a/plugins/tapd/tasks/shared.go b/plugins/tapd/tasks/shared.go
index 27e894ce..48a427a8 100644
--- a/plugins/tapd/tasks/shared.go
+++ b/plugins/tapd/tasks/shared.go
@@ -20,14 +20,15 @@ package tasks
 import (
 	"encoding/json"
 	"fmt"
+	"io/ioutil"
+	"net/http"
+	"net/url"
+
 	"github.com/apache/incubator-devlake/models/domainlayer/didgen"
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"io/ioutil"
-	"net/http"
-	"net/url"
 )
 
 type Page struct {
@@ -74,7 +75,7 @@ func parseIterationChangelog(taskCtx core.SubTaskContext, old string, new string
 			data.Connection.ID, data.Options.WorkspaceId, old),
 	}
 	err := db.First(iterationFrom, clauses...)
-	if err != nil {
+	if err != nil && err.Error() != "record not found" {
 		return 0, 0, err
 	}
 
@@ -85,7 +86,7 @@ func parseIterationChangelog(taskCtx core.SubTaskContext, old string, new string
 			data.Connection.ID, data.Options.WorkspaceId, new),
 	}
 	err = db.First(iterationTo, clauses...)
-	if err != nil {
+	if err != nil && err.Error() != "record not found" {
 		return 0, 0, err
 	}
 	return iterationFrom.Id, iterationTo.Id, nil
diff --git a/plugins/tapd/tasks/story_bug_collector.go b/plugins/tapd/tasks/story_bug_collector.go
index ea5acd99..e60f780d 100644
--- a/plugins/tapd/tasks/story_bug_collector.go
+++ b/plugins/tapd/tasks/story_bug_collector.go
@@ -19,12 +19,13 @@ package tasks
 
 import (
 	"fmt"
+	"net/url"
+	"reflect"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"net/url"
-	"reflect"
 )
 
 const RAW_STORY_BUG_TABLE = "tapd_api_story_bugs"
diff --git a/plugins/tapd/tasks/story_bug_extractor.go b/plugins/tapd/tasks/story_bug_extractor.go
index 40e42611..973fd018 100644
--- a/plugins/tapd/tasks/story_bug_extractor.go
+++ b/plugins/tapd/tasks/story_bug_extractor.go
@@ -19,6 +19,7 @@ package tasks
 
 import (
 	"encoding/json"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
diff --git a/plugins/tapd/tasks/story_category_collector.go b/plugins/tapd/tasks/story_category_collector.go
index 99d7ae7f..4ff75d2d 100644
--- a/plugins/tapd/tasks/story_category_collector.go
+++ b/plugins/tapd/tasks/story_category_collector.go
@@ -20,10 +20,11 @@ package tasks
 import (
 	"encoding/json"
 	"fmt"
-	"github.com/apache/incubator-devlake/plugins/core"
-	"github.com/apache/incubator-devlake/plugins/helper"
 	"net/http"
 	"net/url"
+
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
 const RAW_STORY_CATEGORY_TABLE = "tapd_api_story_categories"
diff --git a/plugins/tapd/tasks/story_category_extractor.go b/plugins/tapd/tasks/story_category_extractor.go
index b24c8966..8caa5318 100644
--- a/plugins/tapd/tasks/story_category_extractor.go
+++ b/plugins/tapd/tasks/story_category_extractor.go
@@ -19,6 +19,7 @@ package tasks
 
 import (
 	"encoding/json"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
diff --git a/plugins/tapd/tasks/story_changelog_collector.go b/plugins/tapd/tasks/story_changelog_collector.go
index 4fe9f34c..17c7622e 100644
--- a/plugins/tapd/tasks/story_changelog_collector.go
+++ b/plugins/tapd/tasks/story_changelog_collector.go
@@ -19,12 +19,13 @@ package tasks
 
 import (
 	"fmt"
+	"net/url"
+	"time"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"net/url"
-	"time"
 )
 
 const RAW_STORY_CHANGELOG_TABLE = "tapd_api_story_changelogs"
diff --git a/plugins/tapd/tasks/story_changelog_converter.go b/plugins/tapd/tasks/story_changelog_converter.go
index 132a8851..71e24b53 100644
--- a/plugins/tapd/tasks/story_changelog_converter.go
+++ b/plugins/tapd/tasks/story_changelog_converter.go
@@ -19,10 +19,11 @@ package tasks
 
 import (
 	"fmt"
-	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"reflect"
 	"time"
 
+	"github.com/apache/incubator-devlake/plugins/core/dal"
+
 	"github.com/apache/incubator-devlake/models/common"
 	"github.com/apache/incubator-devlake/models/domainlayer"
 	"github.com/apache/incubator-devlake/models/domainlayer/didgen"
@@ -33,21 +34,21 @@ import (
 )
 
 type StoryChangelogItemResult struct {
-	ConnectionId      uint64    `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-	Id                uint64    `gorm:"primaryKey;type:BIGINT  NOT NULL" json:"id"`
-	WorkspaceId       uint64    `json:"workspace_id"`
-	WorkitemTypeId    uint64    `json:"workitem_type_id"`
-	Creator           string    `json:"creator"`
-	Created           time.Time `json:"created"`
-	ChangeSummary     string    `json:"change_summary"`
-	Comment           string    `json:"comment"`
-	EntityType        string    `json:"entity_type"`
-	ChangeType        string    `json:"change_type"`
-	StoryId           uint64    `json:"story_id"`
-	ChangelogId       uint64    `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-	Field             string    `json:"field" gorm:"primaryKey;type:varchar(255)"`
-	ValueBeforeParsed string    `json:"value_before"`
-	ValueAfterParsed  string    `json:"value_after"`
+	ConnectionId      uint64     `gorm:"primaryKey;type:BIGINT  NOT NULL"`
+	Id                uint64     `gorm:"primaryKey;type:BIGINT  NOT NULL" json:"id"`
+	WorkspaceId       uint64     `json:"workspace_id"`
+	WorkitemTypeId    uint64     `json:"workitem_type_id"`
+	Creator           string     `json:"creator"`
+	Created           *time.Time `json:"created"`
+	ChangeSummary     string     `json:"change_summary"`
+	Comment           string     `json:"comment"`
+	EntityType        string     `json:"entity_type"`
+	ChangeType        string     `json:"change_type"`
+	StoryId           uint64     `json:"story_id"`
+	ChangelogId       uint64     `gorm:"primaryKey;type:BIGINT  NOT NULL"`
+	Field             string     `json:"field" gorm:"primaryKey;type:varchar(255)"`
+	ValueBeforeParsed string     `json:"value_before"`
+	ValueAfterParsed  string     `json:"value_after"`
 	IterationIdFrom   uint64
 	IterationIdTo     uint64
 	common.NoPKModel
@@ -61,7 +62,7 @@ func ConvertStoryChangelog(taskCtx core.SubTaskContext) error {
 	clIdGen := didgen.NewDomainIdGenerator(&models.TapdStoryChangelog{})
 
 	clauses := []dal.Clause{
-		dal.Select("tc.created, tc.id, tc.workspace_id, tc.story_id, tc.author, _tool_tapd_story_changelog_items.*"),
+		dal.Select("tc.created, tc.id, tc.workspace_id, tc.story_id, tc.creator, _tool_tapd_story_changelog_items.*"),
 		dal.From(&models.TapdStoryChangelogItem{}),
 		dal.Join("left join _tool_tapd_story_changelogs tc on tc.id = _tool_tapd_story_changelog_items.changelog_id "),
 		dal.Where("tc.connection_id = ? AND tc.workspace_id = ?", data.Connection.ID, data.Options.WorkspaceId),
@@ -90,7 +91,7 @@ func ConvertStoryChangelog(taskCtx core.SubTaskContext) error {
 				FieldName:         cl.Field,
 				OriginalFromValue: cl.ValueBeforeParsed,
 				OriginalToValue:   cl.ValueAfterParsed,
-				CreatedDate:       cl.Created,
+				CreatedDate:       *cl.Created,
 			}
 
 			return []interface{}{
diff --git a/plugins/tapd/tasks/story_changelog_extractor.go b/plugins/tapd/tasks/story_changelog_extractor.go
index 7ec2fc82..023e6edb 100644
--- a/plugins/tapd/tasks/story_changelog_extractor.go
+++ b/plugins/tapd/tasks/story_changelog_extractor.go
@@ -19,10 +19,11 @@ package tasks
 
 import (
 	"encoding/json"
+	"strings"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"strings"
 )
 
 var _ core.SubTaskEntryPoint = ExtractStoryChangelog
diff --git a/plugins/tapd/tasks/story_collector.go b/plugins/tapd/tasks/story_collector.go
index ff7f4fb2..382b8e30 100644
--- a/plugins/tapd/tasks/story_collector.go
+++ b/plugins/tapd/tasks/story_collector.go
@@ -19,12 +19,13 @@ package tasks
 
 import (
 	"fmt"
+	"net/url"
+	"time"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"net/url"
-	"time"
 )
 
 const RAW_STORY_TABLE = "tapd_api_stories"
@@ -50,7 +51,7 @@ func CollectStorys(taskCtx core.SubTaskContext) error {
 			return fmt.Errorf("failed to get latest tapd changelog record: %w", err)
 		}
 		if latestUpdated.Id > 0 {
-			since = (*time.Time)(&latestUpdated.Modified)
+			since = (*time.Time)(latestUpdated.Modified)
 			incremental = true
 		}
 	}
diff --git a/plugins/tapd/tasks/story_commit_collector.go b/plugins/tapd/tasks/story_commit_collector.go
index a6cbe7e1..99b92493 100644
--- a/plugins/tapd/tasks/story_commit_collector.go
+++ b/plugins/tapd/tasks/story_commit_collector.go
@@ -20,14 +20,15 @@ package tasks
 import (
 	"encoding/json"
 	"fmt"
-	"github.com/apache/incubator-devlake/plugins/core"
-	"github.com/apache/incubator-devlake/plugins/core/dal"
-	"github.com/apache/incubator-devlake/plugins/helper"
-	"github.com/apache/incubator-devlake/plugins/tapd/models"
 	"net/http"
 	"net/url"
 	"reflect"
 	"time"
+
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/core/dal"
+	"github.com/apache/incubator-devlake/plugins/helper"
+	"github.com/apache/incubator-devlake/plugins/tapd/models"
 )
 
 const RAW_STORY_COMMIT_TABLE = "tapd_api_story_commits"
@@ -58,7 +59,7 @@ func CollectStoryCommits(taskCtx core.SubTaskContext) error {
 			return fmt.Errorf("failed to get latest tapd changelog record: %w", err)
 		}
 		if latestUpdated.Id > 0 {
-			since = (*time.Time)(&latestUpdated.Created)
+			since = (*time.Time)(latestUpdated.Created)
 			incremental = true
 		}
 	}
diff --git a/plugins/tapd/tasks/story_commit_converter.go b/plugins/tapd/tasks/story_commit_converter.go
index f762f6d2..229301cf 100644
--- a/plugins/tapd/tasks/story_commit_converter.go
+++ b/plugins/tapd/tasks/story_commit_converter.go
@@ -18,12 +18,13 @@ limitations under the License.
 package tasks
 
 import (
+	"reflect"
+
 	"github.com/apache/incubator-devlake/models/domainlayer/crossdomain"
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"reflect"
 )
 
 func ConvertStoryCommit(taskCtx core.SubTaskContext) error {
diff --git a/plugins/tapd/tasks/story_commit_extractor.go b/plugins/tapd/tasks/story_commit_extractor.go
index 9649b57d..030a17a5 100644
--- a/plugins/tapd/tasks/story_commit_extractor.go
+++ b/plugins/tapd/tasks/story_commit_extractor.go
@@ -19,6 +19,7 @@ package tasks
 
 import (
 	"encoding/json"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
diff --git a/plugins/tapd/tasks/story_converter.go b/plugins/tapd/tasks/story_converter.go
index 919811a2..fed0194e 100644
--- a/plugins/tapd/tasks/story_converter.go
+++ b/plugins/tapd/tasks/story_converter.go
@@ -18,11 +18,12 @@ limitations under the License.
 package tasks
 
 import (
-	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"reflect"
 	"strconv"
 	"time"
 
+	"github.com/apache/incubator-devlake/plugins/core/dal"
+
 	"github.com/apache/incubator-devlake/models/domainlayer"
 	"github.com/apache/incubator-devlake/models/domainlayer/ticket"
 	"github.com/apache/incubator-devlake/plugins/core"
@@ -63,9 +64,9 @@ func ConvertStory(taskCtx core.SubTaskContext) error {
 				Status:               toolL.StdStatus,
 				StoryPoint:           uint(toolL.Size),
 				OriginalStatus:       toolL.Status,
-				ResolutionDate:       (*time.Time)(&toolL.Completed),
-				CreatedDate:          (*time.Time)(&toolL.Created),
-				UpdatedDate:          (*time.Time)(&toolL.Modified),
+				ResolutionDate:       (*time.Time)(toolL.Completed),
+				CreatedDate:          (*time.Time)(toolL.Created),
+				UpdatedDate:          (*time.Time)(toolL.Modified),
 				ParentIssueId:        IssueIdGen.Generate(toolL.ConnectionId, toolL.ParentId),
 				Priority:             toolL.Priority,
 				TimeRemainingMinutes: int64(toolL.Remain),
diff --git a/plugins/tapd/tasks/story_custom_fields_collector.go b/plugins/tapd/tasks/story_custom_fields_collector.go
index cbf2b492..d6dca4d4 100644
--- a/plugins/tapd/tasks/story_custom_fields_collector.go
+++ b/plugins/tapd/tasks/story_custom_fields_collector.go
@@ -20,10 +20,11 @@ package tasks
 import (
 	"encoding/json"
 	"fmt"
-	"github.com/apache/incubator-devlake/plugins/core"
-	"github.com/apache/incubator-devlake/plugins/helper"
 	"net/http"
 	"net/url"
+
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
 const RAW_STORY_CUSTOM_FIELDS_TABLE = "tapd_api_story_custom_fields"
diff --git a/plugins/tapd/tasks/story_custom_fields_extractor.go b/plugins/tapd/tasks/story_custom_fields_extractor.go
index cdb6f512..5b31f9e2 100644
--- a/plugins/tapd/tasks/story_custom_fields_extractor.go
+++ b/plugins/tapd/tasks/story_custom_fields_extractor.go
@@ -19,6 +19,7 @@ package tasks
 
 import (
 	"encoding/json"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
diff --git a/plugins/tapd/tasks/story_extractor.go b/plugins/tapd/tasks/story_extractor.go
index 725a2907..0067aec6 100644
--- a/plugins/tapd/tasks/story_extractor.go
+++ b/plugins/tapd/tasks/story_extractor.go
@@ -20,12 +20,13 @@ package tasks
 import (
 	"encoding/json"
 	"fmt"
+	"strings"
+
 	"github.com/apache/incubator-devlake/models/domainlayer/ticket"
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"strings"
 )
 
 var _ core.SubTaskEntryPoint = ExtractStories
@@ -43,7 +44,6 @@ func ExtractStories(taskCtx core.SubTaskContext) error {
 	statusList := make([]*models.TapdStoryStatus, 0)
 	clauses := []dal.Clause{
 		dal.Where("connection_id = ? and workspace_id = ?", data.Options.ConnectionId, data.Options.WorkspaceId),
-		dal.Orderby("created DESC"),
 	}
 	err := db.All(&statusList, clauses...)
 	if err != nil {
@@ -96,8 +96,8 @@ func ExtractStories(taskCtx core.SubTaskContext) error {
 					IterationId:      toolL.IterationId,
 					StoryId:          toolL.Id,
 					WorkspaceId:      toolL.WorkspaceId,
-					ResolutionDate:   toolL.Completed,
-					StoryCreatedDate: toolL.Created,
+					ResolutionDate:   *toolL.Completed,
+					StoryCreatedDate: *toolL.Created,
 				}
 				results = append(results, iterationStory)
 			}
diff --git a/plugins/tapd/tasks/story_label_convertor.go b/plugins/tapd/tasks/story_label_convertor.go
index 79295fc6..b02076e9 100644
--- a/plugins/tapd/tasks/story_label_convertor.go
+++ b/plugins/tapd/tasks/story_label_convertor.go
@@ -18,9 +18,10 @@ limitations under the License.
 package tasks
 
 import (
+	"reflect"
+
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"reflect"
 
 	"github.com/apache/incubator-devlake/models/domainlayer/ticket"
 	"github.com/apache/incubator-devlake/plugins/core"
@@ -39,7 +40,8 @@ func ConvertStoryLabels(taskCtx core.SubTaskContext) error {
 	rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx, RAW_STORY_TABLE)
 
 	clauses := []dal.Clause{
-		dal.Join(`left join _tool_tapd_workspace_stories on _tool_tapd_workspace_stories.story_id = _tool_tapd_story_labels.story_id`),
+		dal.From(&models.TapdStoryLabel{}),
+		dal.Join("left join _tool_tapd_workspace_stories on _tool_tapd_workspace_stories.story_id = _tool_tapd_story_labels.story_id"),
 		dal.Where("_tool_tapd_workspace_stories.workspace_id = ? and _tool_tapd_workspace_stories.connection_id = ?",
 			data.Options.WorkspaceId, data.Options.ConnectionId),
 		dal.Orderby("story_id ASC"),
diff --git a/plugins/tapd/tasks/story_status_collector.go b/plugins/tapd/tasks/story_status_collector.go
index 740b867b..8be720ef 100644
--- a/plugins/tapd/tasks/story_status_collector.go
+++ b/plugins/tapd/tasks/story_status_collector.go
@@ -19,9 +19,10 @@ package tasks
 
 import (
 	"fmt"
+	"net/url"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
-	"net/url"
 )
 
 const RAW_STORY_STATUS_TABLE = "tapd_api_story_status"
diff --git a/plugins/tapd/tasks/story_status_extractor.go b/plugins/tapd/tasks/story_status_extractor.go
index 03055f6e..1494ceec 100644
--- a/plugins/tapd/tasks/story_status_extractor.go
+++ b/plugins/tapd/tasks/story_status_extractor.go
@@ -19,6 +19,7 @@ package tasks
 
 import (
 	"encoding/json"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
diff --git a/plugins/tapd/tasks/task_changelog_collector.go b/plugins/tapd/tasks/task_changelog_collector.go
index 5be10e5b..b9dbbfef 100644
--- a/plugins/tapd/tasks/task_changelog_collector.go
+++ b/plugins/tapd/tasks/task_changelog_collector.go
@@ -19,12 +19,13 @@ package tasks
 
 import (
 	"fmt"
+	"net/url"
+	"time"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"net/url"
-	"time"
 )
 
 const RAW_TASK_CHANGELOG_TABLE = "tapd_api_task_changelogs"
diff --git a/plugins/tapd/tasks/task_changelog_converter.go b/plugins/tapd/tasks/task_changelog_converter.go
index 935d6c1a..3331eea7 100644
--- a/plugins/tapd/tasks/task_changelog_converter.go
+++ b/plugins/tapd/tasks/task_changelog_converter.go
@@ -19,10 +19,11 @@ package tasks
 
 import (
 	"fmt"
-	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"reflect"
 	"time"
 
+	"github.com/apache/incubator-devlake/plugins/core/dal"
+
 	"github.com/apache/incubator-devlake/models/common"
 	"github.com/apache/incubator-devlake/models/domainlayer"
 	"github.com/apache/incubator-devlake/models/domainlayer/didgen"
@@ -33,22 +34,22 @@ import (
 )
 
 type TaskChangelogItemResult struct {
-	ConnectionId      uint64    `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-	Id                uint64    `gorm:"primaryKey;type:BIGINT  NOT NULL" json:"id"`
-	WorkspaceId       uint64    `json:"workspace_id"`
-	WorkitemTypeId    uint64    `json:"workitem_type_id"`
-	Creator           string    `json:"creator"`
-	Created           time.Time `json:"created"`
-	ChangeSummary     string    `json:"change_summary"`
-	Comment           string    `json:"comment"`
-	EntityType        string    `json:"entity_type"`
-	ChangeType        string    `json:"change_type"`
-	ChangeTypeText    string    `json:"change_type_text"`
-	TaskId            uint64    `json:"task_id"`
-	ChangelogId       uint64    `gorm:"primaryKey;type:BIGINT  NOT NULL"`
-	Field             string    `json:"field" gorm:"primaryKey;type:varchar(255)"`
-	ValueBeforeParsed string    `json:"value_before"`
-	ValueAfterParsed  string    `json:"value_after"`
+	ConnectionId      uint64     `gorm:"primaryKey;type:BIGINT  NOT NULL"`
+	Id                uint64     `gorm:"primaryKey;type:BIGINT  NOT NULL" json:"id"`
+	WorkspaceId       uint64     `json:"workspace_id"`
+	WorkitemTypeId    uint64     `json:"workitem_type_id"`
+	Creator           string     `json:"creator"`
+	Created           *time.Time `json:"created"`
+	ChangeSummary     string     `json:"change_summary"`
+	Comment           string     `json:"comment"`
+	EntityType        string     `json:"entity_type"`
+	ChangeType        string     `json:"change_type"`
+	ChangeTypeText    string     `json:"change_type_text"`
+	TaskId            uint64     `json:"task_id"`
+	ChangelogId       uint64     `gorm:"primaryKey;type:BIGINT  NOT NULL"`
+	Field             string     `json:"field" gorm:"primaryKey;type:varchar(255)"`
+	ValueBeforeParsed string     `json:"value_before"`
+	ValueAfterParsed  string     `json:"value_after"`
 	IterationIdFrom   uint64
 	IterationIdTo     uint64
 	common.NoPKModel
@@ -62,7 +63,7 @@ func ConvertTaskChangelog(taskCtx core.SubTaskContext) error {
 	clIdGen := didgen.NewDomainIdGenerator(&models.TapdTaskChangelog{})
 
 	clauses := []dal.Clause{
-		dal.Select("tc.created, tc.id, tc.workspace_id, tc.task_id, tc.author, _tool_tapd_task_changelog_items.*"),
+		dal.Select("tc.created, tc.id, tc.workspace_id, tc.task_id, tc.creator, _tool_tapd_task_changelog_items.*"),
 		dal.From(&models.TapdTaskChangelogItem{}),
 		dal.Join("left join _tool_tapd_task_changelogs tc on tc.id = _tool_tapd_task_changelog_items.changelog_id "),
 		dal.Where("tc.connection_id = ? AND tc.workspace_id = ?", data.Connection.ID, data.Options.WorkspaceId),
@@ -90,7 +91,7 @@ func ConvertTaskChangelog(taskCtx core.SubTaskContext) error {
 				FieldName:         cl.Field,
 				OriginalFromValue: cl.ValueBeforeParsed,
 				OriginalToValue:   cl.ValueAfterParsed,
-				CreatedDate:       cl.Created,
+				CreatedDate:       *cl.Created,
 			}
 
 			return []interface{}{
diff --git a/plugins/tapd/tasks/task_changelog_extractor.go b/plugins/tapd/tasks/task_changelog_extractor.go
index 1e0a77c2..80754587 100644
--- a/plugins/tapd/tasks/task_changelog_extractor.go
+++ b/plugins/tapd/tasks/task_changelog_extractor.go
@@ -19,10 +19,11 @@ package tasks
 
 import (
 	"encoding/json"
+	"strings"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"strings"
 )
 
 var _ core.SubTaskEntryPoint = ExtractTaskChangelog
diff --git a/plugins/tapd/tasks/task_collector.go b/plugins/tapd/tasks/task_collector.go
index bcb2d23b..9e42c907 100644
--- a/plugins/tapd/tasks/task_collector.go
+++ b/plugins/tapd/tasks/task_collector.go
@@ -19,12 +19,13 @@ package tasks
 
 import (
 	"fmt"
+	"net/url"
+	"time"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"net/url"
-	"time"
 )
 
 const RAW_TASK_TABLE = "tapd_api_tasks"
@@ -52,7 +53,7 @@ func CollectTasks(taskCtx core.SubTaskContext) error {
 			return fmt.Errorf("failed to get latest tapd changelog record: %w", err)
 		}
 		if latestUpdated.Id > 0 {
-			since = (*time.Time)(&latestUpdated.Modified)
+			since = (*time.Time)(latestUpdated.Modified)
 			incremental = true
 		}
 	}
diff --git a/plugins/tapd/tasks/task_commit_collector.go b/plugins/tapd/tasks/task_commit_collector.go
index bbd490af..dbe12e1b 100644
--- a/plugins/tapd/tasks/task_commit_collector.go
+++ b/plugins/tapd/tasks/task_commit_collector.go
@@ -20,14 +20,15 @@ package tasks
 import (
 	"encoding/json"
 	"fmt"
-	"github.com/apache/incubator-devlake/plugins/core"
-	"github.com/apache/incubator-devlake/plugins/core/dal"
-	"github.com/apache/incubator-devlake/plugins/helper"
-	"github.com/apache/incubator-devlake/plugins/tapd/models"
 	"net/http"
 	"net/url"
 	"reflect"
 	"time"
+
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/core/dal"
+	"github.com/apache/incubator-devlake/plugins/helper"
+	"github.com/apache/incubator-devlake/plugins/tapd/models"
 )
 
 const RAW_TASK_COMMIT_TABLE = "tapd_api_task_commits"
@@ -58,7 +59,7 @@ func CollectTaskCommits(taskCtx core.SubTaskContext) error {
 			return fmt.Errorf("failed to get latest tapd changelog record: %w", err)
 		}
 		if latestUpdated.Id > 0 {
-			since = (*time.Time)(&latestUpdated.Created)
+			since = (*time.Time)(latestUpdated.Created)
 			incremental = true
 		}
 	}
diff --git a/plugins/tapd/tasks/task_commit_converter.go b/plugins/tapd/tasks/task_commit_converter.go
index 2d0884e7..5426730c 100644
--- a/plugins/tapd/tasks/task_commit_converter.go
+++ b/plugins/tapd/tasks/task_commit_converter.go
@@ -18,12 +18,13 @@ limitations under the License.
 package tasks
 
 import (
+	"reflect"
+
 	"github.com/apache/incubator-devlake/models/domainlayer/crossdomain"
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"reflect"
 )
 
 func ConvertTaskCommit(taskCtx core.SubTaskContext) error {
diff --git a/plugins/tapd/tasks/task_commit_extractor.go b/plugins/tapd/tasks/task_commit_extractor.go
index a1f745b3..b7eea1c0 100644
--- a/plugins/tapd/tasks/task_commit_extractor.go
+++ b/plugins/tapd/tasks/task_commit_extractor.go
@@ -19,6 +19,7 @@ package tasks
 
 import (
 	"encoding/json"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
diff --git a/plugins/tapd/tasks/task_converter.go b/plugins/tapd/tasks/task_converter.go
index 001cfaf8..7aaf29b3 100644
--- a/plugins/tapd/tasks/task_converter.go
+++ b/plugins/tapd/tasks/task_converter.go
@@ -18,11 +18,12 @@ limitations under the License.
 package tasks
 
 import (
-	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"reflect"
 	"strconv"
 	"time"
 
+	"github.com/apache/incubator-devlake/plugins/core/dal"
+
 	"github.com/apache/incubator-devlake/models/domainlayer"
 	"github.com/apache/incubator-devlake/models/domainlayer/ticket"
 	"github.com/apache/incubator-devlake/plugins/core"
@@ -63,9 +64,9 @@ func ConvertTask(taskCtx core.SubTaskContext) error {
 				Type:           toolL.StdType,
 				Status:         toolL.StdStatus,
 				OriginalStatus: toolL.Status,
-				ResolutionDate: (*time.Time)(&toolL.Completed),
-				CreatedDate:    (*time.Time)(&toolL.Created),
-				UpdatedDate:    (*time.Time)(&toolL.Modified),
+				ResolutionDate: (*time.Time)(toolL.Completed),
+				CreatedDate:    (*time.Time)(toolL.Created),
+				UpdatedDate:    (*time.Time)(toolL.Modified),
 				ParentIssueId:  IssueIdGen.Generate(toolL.ConnectionId, toolL.StoryId),
 				Priority:       toolL.Priority,
 				CreatorId:      UserIdGen.Generate(data.Connection.ID, toolL.WorkspaceId, toolL.Creator),
diff --git a/plugins/tapd/tasks/task_custom_fields_collector.go b/plugins/tapd/tasks/task_custom_fields_collector.go
index e6ebe505..b60a0be4 100644
--- a/plugins/tapd/tasks/task_custom_fields_collector.go
+++ b/plugins/tapd/tasks/task_custom_fields_collector.go
@@ -20,10 +20,11 @@ package tasks
 import (
 	"encoding/json"
 	"fmt"
-	"github.com/apache/incubator-devlake/plugins/core"
-	"github.com/apache/incubator-devlake/plugins/helper"
 	"net/http"
 	"net/url"
+
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
 const RAW_TASK_CUSTOM_FIELDS_TABLE = "tapd_api_task_custom_fields"
diff --git a/plugins/tapd/tasks/task_custom_fields_extractor.go b/plugins/tapd/tasks/task_custom_fields_extractor.go
index 9ab02315..78518611 100644
--- a/plugins/tapd/tasks/task_custom_fields_extractor.go
+++ b/plugins/tapd/tasks/task_custom_fields_extractor.go
@@ -19,6 +19,7 @@ package tasks
 
 import (
 	"encoding/json"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
diff --git a/plugins/tapd/tasks/task_extractor.go b/plugins/tapd/tasks/task_extractor.go
index 20e0c7b0..bf7318e3 100644
--- a/plugins/tapd/tasks/task_extractor.go
+++ b/plugins/tapd/tasks/task_extractor.go
@@ -20,11 +20,12 @@ package tasks
 import (
 	"encoding/json"
 	"fmt"
+	"strings"
+
 	"github.com/apache/incubator-devlake/models/domainlayer/ticket"
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"strings"
 )
 
 var _ core.SubTaskEntryPoint = ExtractTasks
@@ -83,8 +84,8 @@ func ExtractTasks(taskCtx core.SubTaskContext) error {
 					IterationId:     toolL.IterationId,
 					TaskId:          toolL.Id,
 					WorkspaceId:     toolL.WorkspaceId,
-					ResolutionDate:  toolL.Completed,
-					TaskCreatedDate: toolL.Created,
+					ResolutionDate:  *toolL.Completed,
+					TaskCreatedDate: *toolL.Created,
 				}
 				results = append(results, iterationTask)
 			}
diff --git a/plugins/tapd/tasks/task_label_convertor.go b/plugins/tapd/tasks/task_label_convertor.go
index 4222d3b2..043b543b 100644
--- a/plugins/tapd/tasks/task_label_convertor.go
+++ b/plugins/tapd/tasks/task_label_convertor.go
@@ -18,9 +18,10 @@ limitations under the License.
 package tasks
 
 import (
+	"reflect"
+
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"reflect"
 
 	"github.com/apache/incubator-devlake/models/domainlayer/ticket"
 	"github.com/apache/incubator-devlake/plugins/core"
@@ -39,7 +40,8 @@ func ConvertTaskLabels(taskCtx core.SubTaskContext) error {
 	rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx, RAW_TASK_TABLE)
 
 	clauses := []dal.Clause{
-		dal.Join(`left join _tool_tapd_workspace_tasks on _tool_tapd_workspace_tasks.task_id = _tool_tapd_task_labels.task_id`),
+		dal.From(&models.TapdTaskLabel{}),
+		dal.Join("left join _tool_tapd_workspace_tasks on _tool_tapd_workspace_tasks.task_id = _tool_tapd_task_labels.task_id"),
 		dal.Where("_tool_tapd_workspace_tasks.workspace_id = ? and _tool_tapd_workspace_tasks.connection_id = ?",
 			data.Options.WorkspaceId, data.Options.ConnectionId),
 		dal.Orderby("task_id ASC"),
diff --git a/plugins/tapd/tasks/user_collector.go b/plugins/tapd/tasks/user_collector.go
index 49bdbfe2..11d668e0 100644
--- a/plugins/tapd/tasks/user_collector.go
+++ b/plugins/tapd/tasks/user_collector.go
@@ -20,10 +20,11 @@ package tasks
 import (
 	"encoding/json"
 	"fmt"
-	"github.com/apache/incubator-devlake/plugins/core"
-	"github.com/apache/incubator-devlake/plugins/helper"
 	"net/http"
 	"net/url"
+
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
 const RAW_USER_TABLE = "tapd_api_users"
diff --git a/plugins/tapd/tasks/user_converter.go b/plugins/tapd/tasks/user_converter.go
index f5f5643e..955346ec 100644
--- a/plugins/tapd/tasks/user_converter.go
+++ b/plugins/tapd/tasks/user_converter.go
@@ -18,13 +18,14 @@ limitations under the License.
 package tasks
 
 import (
+	"reflect"
+
 	"github.com/apache/incubator-devlake/models/domainlayer"
 	"github.com/apache/incubator-devlake/models/domainlayer/user"
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"reflect"
 )
 
 func ConvertUser(taskCtx core.SubTaskContext) error {
diff --git a/plugins/tapd/tasks/user_extractor.go b/plugins/tapd/tasks/user_extractor.go
index 51ccfa67..a552e5fc 100644
--- a/plugins/tapd/tasks/user_extractor.go
+++ b/plugins/tapd/tasks/user_extractor.go
@@ -19,6 +19,7 @@ package tasks
 
 import (
 	"encoding/json"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
diff --git a/plugins/tapd/tasks/worklog_collector.go b/plugins/tapd/tasks/worklog_collector.go
index 4271f8db..a369df06 100644
--- a/plugins/tapd/tasks/worklog_collector.go
+++ b/plugins/tapd/tasks/worklog_collector.go
@@ -19,12 +19,13 @@ package tasks
 
 import (
 	"fmt"
+	"net/url"
+	"time"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"net/url"
-	"time"
 )
 
 const RAW_WORKLOG_TABLE = "tapd_api_worklogs"
@@ -50,7 +51,7 @@ func CollectWorklogs(taskCtx core.SubTaskContext) error {
 			return fmt.Errorf("failed to get latest tapd changelog record: %w", err)
 		}
 		if latestUpdated.Id > 0 {
-			since = (*time.Time)(&latestUpdated.Created)
+			since = (*time.Time)(latestUpdated.Created)
 			incremental = true
 		}
 	}
diff --git a/plugins/tapd/tasks/worklog_converter.go b/plugins/tapd/tasks/worklog_converter.go
index 0f2f1afb..a851d060 100644
--- a/plugins/tapd/tasks/worklog_converter.go
+++ b/plugins/tapd/tasks/worklog_converter.go
@@ -18,6 +18,9 @@ limitations under the License.
 package tasks
 
 import (
+	"reflect"
+	"time"
+
 	"github.com/apache/incubator-devlake/models/domainlayer"
 	"github.com/apache/incubator-devlake/models/domainlayer/didgen"
 	"github.com/apache/incubator-devlake/models/domainlayer/ticket"
@@ -25,8 +28,6 @@ import (
 	"github.com/apache/incubator-devlake/plugins/core/dal"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
-	"reflect"
-	"time"
 )
 
 func ConvertWorklog(taskCtx core.SubTaskContext) error {
@@ -58,7 +59,7 @@ func ConvertWorklog(taskCtx core.SubTaskContext) error {
 				AuthorId:         UserIdGen.Generate(data.Connection.ID, toolL.WorkspaceId, toolL.Owner),
 				Comment:          toolL.Memo,
 				TimeSpentMinutes: int(toolL.Timespent),
-				LoggedDate:       (*time.Time)(&toolL.Created),
+				LoggedDate:       (*time.Time)(toolL.Created),
 				//IssueId:          toolL.EntityId,
 			}
 			switch toolL.EntityType {
diff --git a/plugins/tapd/tasks/worklog_extractor.go b/plugins/tapd/tasks/worklog_extractor.go
index bf20d3dc..dd1c0ca9 100644
--- a/plugins/tapd/tasks/worklog_extractor.go
+++ b/plugins/tapd/tasks/worklog_extractor.go
@@ -19,6 +19,7 @@ package tasks
 
 import (
 	"encoding/json"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"
diff --git a/plugins/tapd/tasks/workspace_collector.go b/plugins/tapd/tasks/workspace_collector.go
index 30facf79..251c3e20 100644
--- a/plugins/tapd/tasks/workspace_collector.go
+++ b/plugins/tapd/tasks/workspace_collector.go
@@ -20,10 +20,11 @@ package tasks
 import (
 	"encoding/json"
 	"fmt"
-	"github.com/apache/incubator-devlake/plugins/core"
-	"github.com/apache/incubator-devlake/plugins/helper"
 	"net/http"
 	"net/url"
+
+	"github.com/apache/incubator-devlake/plugins/core"
+	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
 const RAW_WORKSPACE_TABLE = "tapd_api_sub_workspaces"
diff --git a/plugins/tapd/tasks/workspace_converter.go b/plugins/tapd/tasks/workspace_converter.go
index 71a35ba1..f66b6c52 100644
--- a/plugins/tapd/tasks/workspace_converter.go
+++ b/plugins/tapd/tasks/workspace_converter.go
@@ -35,7 +35,7 @@ func ConvertWorkspace(taskCtx core.SubTaskContext) error {
 	logger.Info("collect board:%d", data.Options.WorkspaceId)
 	clauses := []dal.Clause{
 		dal.From(&models.TapdWorkspace{}),
-		dal.Where("connection_id = ? AND workspace_id = ?", data.Connection.ID, data.Options.WorkspaceId),
+		dal.Where("connection_id = ? AND id = ?", data.Connection.ID, data.Options.WorkspaceId),
 	}
 
 	cursor, err := db.Cursor(clauses...)
diff --git a/plugins/tapd/tasks/workspace_extractor.go b/plugins/tapd/tasks/workspace_extractor.go
index f010cafc..eebef7ae 100644
--- a/plugins/tapd/tasks/workspace_extractor.go
+++ b/plugins/tapd/tasks/workspace_extractor.go
@@ -19,6 +19,7 @@ package tasks
 
 import (
 	"encoding/json"
+
 	"github.com/apache/incubator-devlake/plugins/core"
 	"github.com/apache/incubator-devlake/plugins/helper"
 	"github.com/apache/incubator-devlake/plugins/tapd/models"


[incubator-devlake] 02/02: fix: some field is error and fix bugs

Posted by wa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 303263ff8901f8e7868f362e2d8a9ad7c54a229e
Author: abeizn <zi...@merico.dev>
AuthorDate: Tue Jun 21 20:39:30 2022 +0800

    fix: some field is error and fix bugs
---
 plugins/tapd/impl/impl.go                          |   2 +-
 .../tapd/models/migrationscripts/archived/bug.go   |   4 +-
 .../migrationscripts/archived/bug_changelog.go     |   6 +-
 .../models/migrationscripts/archived/bug_commit.go |   4 +-
 .../migrationscripts/archived/bug_custom_field.go  |   4 +-
 .../models/migrationscripts/archived/bug_label.go  |   6 +-
 .../models/migrationscripts/archived/bug_status.go |   6 +-
 .../models/migrationscripts/archived/iteration.go  |   6 +-
 .../migrationscripts/archived/iteration_bug.go     |   4 +-
 .../migrationscripts/archived/iteration_task.go    |   4 +-
 .../tapd/models/migrationscripts/archived/story.go | 212 ++++++++++-----------
 .../models/migrationscripts/archived/story_bug.go  |   6 +-
 .../migrationscripts/archived/story_category.go    |   4 +-
 .../migrationscripts/archived/story_changelog.go   |   6 +-
 .../migrationscripts/archived/story_commits.go     |   4 +-
 .../archived/story_custom_field.go                 |   4 +-
 .../migrationscripts/archived/story_label.go       |   6 +-
 .../migrationscripts/archived/story_status.go      |   6 +-
 .../tapd/models/migrationscripts/archived/task.go  |   5 +-
 .../migrationscripts/archived/task_changelog.go    |   6 +-
 .../migrationscripts/archived/task_commits.go      |   4 +-
 .../migrationscripts/archived/task_custom_field.go |   4 +-
 .../models/migrationscripts/archived/task_label.go |   6 +-
 .../tapd/models/migrationscripts/archived/user.go  |   6 +-
 .../models/migrationscripts/archived/worklog.go    |   4 +-
 .../models/migrationscripts/archived/workspace.go  |   6 +-
 .../migrationscripts/archived/workspace_bug.go     |   6 +-
 .../migrationscripts/archived/workspace_story.go   |   6 +-
 .../migrationscripts/archived/workspace_task.go    |   6 +-
 29 files changed, 167 insertions(+), 186 deletions(-)

diff --git a/plugins/tapd/impl/impl.go b/plugins/tapd/impl/impl.go
index d05d0d61..c102121f 100644
--- a/plugins/tapd/impl/impl.go
+++ b/plugins/tapd/impl/impl.go
@@ -142,7 +142,7 @@ func (plugin Tapd) PrepareTaskData(taskCtx core.TaskContext, options map[string]
 		}
 	}
 	if connection.RateLimit == 0 {
-		connection.RateLimit = 2000
+		connection.RateLimit = 6000
 	}
 	tapdApiClient, err := tasks.NewTapdApiClient(taskCtx, connection)
 	if err != nil {
diff --git a/plugins/tapd/models/migrationscripts/archived/bug.go b/plugins/tapd/models/migrationscripts/archived/bug.go
index 88ee3202..2f4f01f9 100644
--- a/plugins/tapd/models/migrationscripts/archived/bug.go
+++ b/plugins/tapd/models/migrationscripts/archived/bug.go
@@ -18,7 +18,7 @@ limitations under the License.
 package archived
 
 import (
-	"github.com/apache/incubator-devlake/models/common"
+	"github.com/apache/incubator-devlake/models/migrationscripts/archived"
 	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
@@ -42,7 +42,7 @@ type TapdBug struct {
 	ReleaseId    uint64          `json:"release_id,string"`
 	CreatedFrom  string          `json:"created_from" gorm:"type:varchar(255)"`
 	Feature      string          `json:"feature" gorm:"type:varchar(255)"`
-	common.NoPKModel
+	archived.NoPKModel
 
 	Severity         string          `json:"severity" gorm:"type:varchar(255)"`
 	Reporter         string          `json:"reporter" gorm:"type:varchar(255)"`
diff --git a/plugins/tapd/models/migrationscripts/archived/bug_changelog.go b/plugins/tapd/models/migrationscripts/archived/bug_changelog.go
index ec359123..af49c605 100644
--- a/plugins/tapd/models/migrationscripts/archived/bug_changelog.go
+++ b/plugins/tapd/models/migrationscripts/archived/bug_changelog.go
@@ -18,7 +18,7 @@ limitations under the License.
 package archived
 
 import (
-	"github.com/apache/incubator-devlake/models/common"
+	"github.com/apache/incubator-devlake/models/migrationscripts/archived"
 	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
@@ -33,7 +33,7 @@ type TapdBugChangelog struct {
 	NewValue     string         `json:"new_value"`
 	Memo         string         `json:"memo" gorm:"type:text"`
 	Created      helper.CSTTime `json:"created"`
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 type TapdBugChangelogItem struct {
@@ -44,7 +44,7 @@ type TapdBugChangelogItem struct {
 	ValueAfterParsed  string `json:"value_after_parsed"`
 	IterationIdFrom   uint64
 	IterationIdTo     uint64
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdBugChangelog) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/bug_commit.go b/plugins/tapd/models/migrationscripts/archived/bug_commit.go
index c3853161..71761e08 100644
--- a/plugins/tapd/models/migrationscripts/archived/bug_commit.go
+++ b/plugins/tapd/models/migrationscripts/archived/bug_commit.go
@@ -18,7 +18,7 @@ limitations under the License.
 package archived
 
 import (
-	"github.com/apache/incubator-devlake/models/common"
+	"github.com/apache/incubator-devlake/models/migrationscripts/archived"
 	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
@@ -42,7 +42,7 @@ type TapdBugCommit struct {
 	Created         *helper.CSTTime `json:"created"`
 
 	BugId uint64
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdBugCommit) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/bug_custom_field.go b/plugins/tapd/models/migrationscripts/archived/bug_custom_field.go
index 40df4709..7f2e5e5d 100644
--- a/plugins/tapd/models/migrationscripts/archived/bug_custom_field.go
+++ b/plugins/tapd/models/migrationscripts/archived/bug_custom_field.go
@@ -17,7 +17,7 @@ limitations under the License.
 
 package archived
 
-import "github.com/apache/incubator-devlake/models/common"
+import "github.com/apache/incubator-devlake/models/migrationscripts/archived"
 
 type TapdBugCustomFields struct {
 	ConnectionId uint64 `gorm:"primaryKey;type:BIGINT  NOT NULL"`
@@ -30,7 +30,7 @@ type TapdBugCustomFields struct {
 	Options      string `json:"options" gorm:"type:text"`
 	Enabled      string `json:"enabled" gorm:"type:varchar(255)"`
 	Sort         string `json:"sort" gorm:"type:varchar(255)"`
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdBugCustomFields) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/bug_label.go b/plugins/tapd/models/migrationscripts/archived/bug_label.go
index d1c2e6c2..ecc79220 100644
--- a/plugins/tapd/models/migrationscripts/archived/bug_label.go
+++ b/plugins/tapd/models/migrationscripts/archived/bug_label.go
@@ -17,14 +17,12 @@ limitations under the License.
 
 package archived
 
-import (
-	"github.com/apache/incubator-devlake/models/common"
-)
+import "github.com/apache/incubator-devlake/models/migrationscripts/archived"
 
 type TapdBugLabel struct {
 	BugId     uint64 `gorm:"primaryKey;autoIncrement:false"`
 	LabelName string `gorm:"primaryKey;type:varchar(255)"`
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdBugLabel) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/bug_status.go b/plugins/tapd/models/migrationscripts/archived/bug_status.go
index ecc41369..5dd8fdfb 100644
--- a/plugins/tapd/models/migrationscripts/archived/bug_status.go
+++ b/plugins/tapd/models/migrationscripts/archived/bug_status.go
@@ -17,9 +17,7 @@ limitations under the License.
 
 package archived
 
-import (
-	"github.com/apache/incubator-devlake/models/common"
-)
+import "github.com/apache/incubator-devlake/models/migrationscripts/archived"
 
 type TapdBugStatus struct {
 	ConnectionId uint64 `gorm:"primaryKey"`
@@ -27,7 +25,7 @@ type TapdBugStatus struct {
 	EnglishName  string `gorm:"primaryKey;type:varchar(255)"`
 	ChineseName  string
 	IsLastStep   bool
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdBugStatus) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/iteration.go b/plugins/tapd/models/migrationscripts/archived/iteration.go
index b9ad33bd..4237273e 100644
--- a/plugins/tapd/models/migrationscripts/archived/iteration.go
+++ b/plugins/tapd/models/migrationscripts/archived/iteration.go
@@ -18,7 +18,7 @@ limitations under the License.
 package archived
 
 import (
-	"github.com/apache/incubator-devlake/models/common"
+	"github.com/apache/incubator-devlake/models/migrationscripts/archived"
 	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
@@ -40,11 +40,11 @@ type TapdIteration struct {
 	Launchdate   *helper.CSTTime `json:"launchdate"`
 	Notice       string          `gorm:"type:varchar(255)" json:"notice"`
 	Releasename  string          `gorm:"type:varchar(255)" json:"releasename"`
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 type TapdWorkspaceIteration struct {
-	common.NoPKModel
+	archived.NoPKModel
 	ConnectionId uint64 `gorm:"primaryKey"`
 	WorkspaceId  uint64 `gorm:"primaryKey"`
 	IterationId  uint64 `gorm:"primaryKey"`
diff --git a/plugins/tapd/models/migrationscripts/archived/iteration_bug.go b/plugins/tapd/models/migrationscripts/archived/iteration_bug.go
index 780304ee..6c4b0bc3 100644
--- a/plugins/tapd/models/migrationscripts/archived/iteration_bug.go
+++ b/plugins/tapd/models/migrationscripts/archived/iteration_bug.go
@@ -18,12 +18,12 @@ limitations under the License.
 package archived
 
 import (
-	"github.com/apache/incubator-devlake/models/common"
+	"github.com/apache/incubator-devlake/models/migrationscripts/archived"
 	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
 type TapdIterationBug struct {
-	common.NoPKModel
+	archived.NoPKModel
 	ConnectionId   uint64 `gorm:"primaryKey"`
 	IterationId    uint64 `gorm:"primaryKey"`
 	WorkspaceId    uint64 `gorm:"primaryKey"`
diff --git a/plugins/tapd/models/migrationscripts/archived/iteration_task.go b/plugins/tapd/models/migrationscripts/archived/iteration_task.go
index e92880d4..40aa23c7 100644
--- a/plugins/tapd/models/migrationscripts/archived/iteration_task.go
+++ b/plugins/tapd/models/migrationscripts/archived/iteration_task.go
@@ -18,12 +18,12 @@ limitations under the License.
 package archived
 
 import (
-	"github.com/apache/incubator-devlake/models/common"
+	"github.com/apache/incubator-devlake/models/migrationscripts/archived"
 	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
 type TapdIterationTask struct {
-	common.NoPKModel
+	archived.NoPKModel
 	ConnectionId    uint64 `gorm:"primaryKey"`
 	IterationId     uint64 `gorm:"primaryKey"`
 	TaskId          uint64 `gorm:"primaryKey"`
diff --git a/plugins/tapd/models/migrationscripts/archived/story.go b/plugins/tapd/models/migrationscripts/archived/story.go
index 41c7ebc1..6caae2df 100644
--- a/plugins/tapd/models/migrationscripts/archived/story.go
+++ b/plugins/tapd/models/migrationscripts/archived/story.go
@@ -18,117 +18,117 @@ limitations under the License.
 package archived
 
 import (
-	"github.com/apache/incubator-devlake/models/common"
+	"github.com/apache/incubator-devlake/models/migrationscripts/archived"
 	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
 type TapdStory struct {
-	ConnectionId     uint64          `gorm:"primaryKey"`
-	Id               uint64          `gorm:"primaryKey;type:BIGINT" json:"id,string"`
-	WorkitemTypeId   uint64          `json:"workitem_type_id,string"`
-	Name             string          `gorm:"type:varchar(255)" json:"name"`
-	Description      string          `json:"description"`
-	WorkspaceId      uint64          `json:"workspace_id,string"`
-	Creator          string          `gorm:"type:varchar(255)"`
-	Created          *helper.CSTTime `json:"created"`
-	Modified         *helper.CSTTime `json:"modified" gorm:"index"`
-	Status           string          `json:"status" gorm:"type:varchar(255)"`
-	Owner            string          `json:"owner" gorm:"type:varchar(255)"`
-	Cc               string          `json:"cc" gorm:"type:varchar(255)"`
-	Begin            *helper.CSTTime `json:"begin"`
-	Due              *helper.CSTTime `json:"due"`
-	Size             int16           `json:"size,string"`
-	Priority         string          `gorm:"type:varchar(255)" json:"priority"`
-	Developer        string          `gorm:"type:varchar(255)" json:"developer"`
-	IterationId      uint64          `json:"iteration_id,string"`
-	TestFocus        string          `json:"test_focus" gorm:"type:varchar(255)"`
-	Type             string          `json:"type" gorm:"type:varchar(20)"`
-	Source           string          `json:"source" gorm:"type:varchar(255)"`
-	Module           string          `json:"module" gorm:"type:varchar(255)"`
-	Version          string          `json:"version" gorm:"type:varchar(255)"`
-	Completed        *helper.CSTTime `json:"completed"`
-	CategoryId       int64           `json:"category_id,string"`
-	Path             string          `gorm:"type:varchar(255)" json:"path"`
-	ParentId         uint64          `json:"parent_id,string"`
-	ChildrenId       string          `gorm:"type:text" json:"children_id"`
-	AncestorId       uint64          `json:"ancestor_id,string"`
-	BusinessValue    string          `gorm:"type:varchar(255)" json:"business_value"`
-	Effort           float32         `json:"effort,string"`
-	EffortCompleted  float32         `json:"effort_completed,string"`
-	Exceed           float32         `json:"exceed,string"`
-	Remain           float32         `json:"remain,string"`
-	ReleaseId        uint64          `json:"release_id,string"`
-	Confidential     string          `gorm:"type:varchar(255)" json:"confidential"`
-	TemplatedId      uint64          `json:"templated_id,string"`
-	CreatedFrom      string          `gorm:"type:varchar(255)" json:"created_from"`
-	Feature          string          `gorm:"type:varchar(255)" json:"feature"`
-	StdStatus        string          `gorm:"type:varchar(20)"`
-	StdType          string          `gorm:"type:varchar(20)"`
-	Url              string          `gorm:"type:varchar(255)"`
-	
-	AttachmentCount  int16           `json:"attachment_count,string"`
-	HasAttachment    string          `json:"has_attachment" gorm:"type:varchar(255)"`
-	BugId            uint64          `json:"bug_id,string"`
-	Follower         string          `json:"follower" gorm:"type:varchar(255)"`
-	SyncType         string          `json:"sync_type" gorm:"type:text"`
-	PredecessorCount int16           `json:"predecessor_count,string"`
-	IsArchived       string          `json:"is_archived" gorm:"type:varchar(255)"`
-	Modifier         string          `json:"modifier" gorm:"type:varchar(255)"`
-	ProgressManual   string          `json:"progress_manual" gorm:"type:varchar(255)"`
-	SuccessorCount   int16           `json:"successor_count,string"`
-	Label            string          `json:"label" gorm:"type:varchar(255)"`
-	CustomFieldOne   string          `json:"custom_field_one" gorm:"type:text"`
-	CustomFieldTwo   string          `json:"custom_field_two" gorm:"type:text"`
-	CustomFieldThree string          `json:"custom_field_three" gorm:"type:text"`
-	CustomFieldFour  string          `json:"custom_field_four" gorm:"type:text"`
-	CustomFieldFive  string          `json:"custom_field_five" gorm:"type:text"`
-	CustomField6     string          `json:"custom_field_6" gorm:"type:text"`
-	CustomField7     string          `json:"custom_field_7" gorm:"type:text"`
-	CustomField8     string          `json:"custom_field_8" gorm:"type:text"`
-	CustomField9     string          `json:"custom_field_9" gorm:"type:text"`
-	CustomField10    string          `json:"custom_field_10" gorm:"type:text"`
-	CustomField11    string          `json:"custom_field_11" gorm:"type:text"`
-	CustomField12    string          `json:"custom_field_12" gorm:"type:text"`
-	CustomField13    string          `json:"custom_field_13" gorm:"type:text"`
-	CustomField14    string          `json:"custom_field_14" gorm:"type:text"`
-	CustomField15    string          `json:"custom_field_15" gorm:"type:text"`
-	CustomField16    string          `json:"custom_field_16" gorm:"type:text"`
-	CustomField17    string          `json:"custom_field_17" gorm:"type:text"`
-	CustomField18    string          `json:"custom_field_18" gorm:"type:text"`
-	CustomField19    string          `json:"custom_field_19" gorm:"type:text"`
-	CustomField20    string          `json:"custom_field_20" gorm:"type:text"`
-	CustomField21    string          `json:"custom_field_21" gorm:"type:text"`
-	CustomField22    string          `json:"custom_field_22" gorm:"type:text"`
-	CustomField23    string          `json:"custom_field_23" gorm:"type:text"`
-	CustomField24    string          `json:"custom_field_24" gorm:"type:text"`
-	CustomField25    string          `json:"custom_field_25" gorm:"type:text"`
-	CustomField26    string          `json:"custom_field_26" gorm:"type:text"`
-	CustomField27    string          `json:"custom_field_27" gorm:"type:text"`
-	CustomField28    string          `json:"custom_field_28" gorm:"type:text"`
-	CustomField29    string          `json:"custom_field_29" gorm:"type:text"`
-	CustomField30    string          `json:"custom_field_30" gorm:"type:text"`
-	CustomField31    string          `json:"custom_field_31" gorm:"type:text"`
-	CustomField32    string          `json:"custom_field_32" gorm:"type:text"`
-	CustomField33    string          `json:"custom_field_33" gorm:"type:text"`
-	CustomField34    string          `json:"custom_field_34" gorm:"type:text"`
-	CustomField35    string          `json:"custom_field_35" gorm:"type:text"`
-	CustomField36    string          `json:"custom_field_36" gorm:"type:text"`
-	CustomField37    string          `json:"custom_field_37" gorm:"type:text"`
-	CustomField38    string          `json:"custom_field_38" gorm:"type:text"`
-	CustomField39    string          `json:"custom_field_39" gorm:"type:text"`
-	CustomField40    string          `json:"custom_field_40" gorm:"type:text"`
-	CustomField41    string          `json:"custom_field_41" gorm:"type:text"`
-	CustomField42    string          `json:"custom_field_42" gorm:"type:text"`
-	CustomField43    string          `json:"custom_field_43" gorm:"type:text"`
-	CustomField44    string          `json:"custom_field_44" gorm:"type:text"`
-	CustomField45    string          `json:"custom_field_45" gorm:"type:text"`
-	CustomField46    string          `json:"custom_field_46" gorm:"type:text"`
-	CustomField47    string          `json:"custom_field_47" gorm:"type:text"`
-	CustomField48    string          `json:"custom_field_48" gorm:"type:text"`
-	CustomField49    string          `json:"custom_field_49" gorm:"type:text"`
-	CustomField50    string          `json:"custom_field_50" gorm:"type:text"`
+	ConnectionId    uint64          `gorm:"primaryKey"`
+	Id              uint64          `gorm:"primaryKey;type:BIGINT" json:"id,string"`
+	WorkitemTypeId  uint64          `json:"workitem_type_id,string"`
+	Name            string          `gorm:"type:varchar(255)" json:"name"`
+	Description     string          `json:"description"`
+	WorkspaceId     uint64          `json:"workspace_id,string"`
+	Creator         string          `gorm:"type:varchar(255)"`
+	Created         *helper.CSTTime `json:"created"`
+	Modified        *helper.CSTTime `json:"modified" gorm:"index"`
+	Status          string          `json:"status" gorm:"type:varchar(255)"`
+	Owner           string          `json:"owner" gorm:"type:varchar(255)"`
+	Cc              string          `json:"cc" gorm:"type:varchar(255)"`
+	Begin           *helper.CSTTime `json:"begin"`
+	Due             *helper.CSTTime `json:"due"`
+	Size            int16           `json:"size,string"`
+	Priority        string          `gorm:"type:varchar(255)" json:"priority"`
+	Developer       string          `gorm:"type:varchar(255)" json:"developer"`
+	IterationId     uint64          `json:"iteration_id,string"`
+	TestFocus       string          `json:"test_focus" gorm:"type:varchar(255)"`
+	Type            string          `json:"type" gorm:"type:varchar(20)"`
+	Source          string          `json:"source" gorm:"type:varchar(255)"`
+	Module          string          `json:"module" gorm:"type:varchar(255)"`
+	Version         string          `json:"version" gorm:"type:varchar(255)"`
+	Completed       *helper.CSTTime `json:"completed"`
+	CategoryId      int64           `json:"category_id,string"`
+	Path            string          `gorm:"type:varchar(255)" json:"path"`
+	ParentId        uint64          `json:"parent_id,string"`
+	ChildrenId      string          `gorm:"type:text" json:"children_id"`
+	AncestorId      uint64          `json:"ancestor_id,string"`
+	BusinessValue   string          `gorm:"type:varchar(255)" json:"business_value"`
+	Effort          float32         `json:"effort,string"`
+	EffortCompleted float32         `json:"effort_completed,string"`
+	Exceed          float32         `json:"exceed,string"`
+	Remain          float32         `json:"remain,string"`
+	ReleaseId       uint64          `json:"release_id,string"`
+	Confidential    string          `gorm:"type:varchar(255)" json:"confidential"`
+	TemplatedId     uint64          `json:"templated_id,string"`
+	CreatedFrom     string          `gorm:"type:varchar(255)" json:"created_from"`
+	Feature         string          `gorm:"type:varchar(255)" json:"feature"`
+	StdStatus       string          `gorm:"type:varchar(20)"`
+	StdType         string          `gorm:"type:varchar(20)"`
+	Url             string          `gorm:"type:varchar(255)"`
 
-	common.NoPKModel
+	AttachmentCount  int16  `json:"attachment_count,string"`
+	HasAttachment    string `json:"has_attachment" gorm:"type:varchar(255)"`
+	BugId            uint64 `json:"bug_id,string"`
+	Follower         string `json:"follower" gorm:"type:varchar(255)"`
+	SyncType         string `json:"sync_type" gorm:"type:text"`
+	PredecessorCount int16  `json:"predecessor_count,string"`
+	IsArchived       string `json:"is_archived" gorm:"type:varchar(255)"`
+	Modifier         string `json:"modifier" gorm:"type:varchar(255)"`
+	ProgressManual   string `json:"progress_manual" gorm:"type:varchar(255)"`
+	SuccessorCount   int16  `json:"successor_count,string"`
+	Label            string `json:"label" gorm:"type:varchar(255)"`
+	CustomFieldOne   string `json:"custom_field_one" gorm:"type:text"`
+	CustomFieldTwo   string `json:"custom_field_two" gorm:"type:text"`
+	CustomFieldThree string `json:"custom_field_three" gorm:"type:text"`
+	CustomFieldFour  string `json:"custom_field_four" gorm:"type:text"`
+	CustomFieldFive  string `json:"custom_field_five" gorm:"type:text"`
+	CustomField6     string `json:"custom_field_6" gorm:"type:text"`
+	CustomField7     string `json:"custom_field_7" gorm:"type:text"`
+	CustomField8     string `json:"custom_field_8" gorm:"type:text"`
+	CustomField9     string `json:"custom_field_9" gorm:"type:text"`
+	CustomField10    string `json:"custom_field_10" gorm:"type:text"`
+	CustomField11    string `json:"custom_field_11" gorm:"type:text"`
+	CustomField12    string `json:"custom_field_12" gorm:"type:text"`
+	CustomField13    string `json:"custom_field_13" gorm:"type:text"`
+	CustomField14    string `json:"custom_field_14" gorm:"type:text"`
+	CustomField15    string `json:"custom_field_15" gorm:"type:text"`
+	CustomField16    string `json:"custom_field_16" gorm:"type:text"`
+	CustomField17    string `json:"custom_field_17" gorm:"type:text"`
+	CustomField18    string `json:"custom_field_18" gorm:"type:text"`
+	CustomField19    string `json:"custom_field_19" gorm:"type:text"`
+	CustomField20    string `json:"custom_field_20" gorm:"type:text"`
+	CustomField21    string `json:"custom_field_21" gorm:"type:text"`
+	CustomField22    string `json:"custom_field_22" gorm:"type:text"`
+	CustomField23    string `json:"custom_field_23" gorm:"type:text"`
+	CustomField24    string `json:"custom_field_24" gorm:"type:text"`
+	CustomField25    string `json:"custom_field_25" gorm:"type:text"`
+	CustomField26    string `json:"custom_field_26" gorm:"type:text"`
+	CustomField27    string `json:"custom_field_27" gorm:"type:text"`
+	CustomField28    string `json:"custom_field_28" gorm:"type:text"`
+	CustomField29    string `json:"custom_field_29" gorm:"type:text"`
+	CustomField30    string `json:"custom_field_30" gorm:"type:text"`
+	CustomField31    string `json:"custom_field_31" gorm:"type:text"`
+	CustomField32    string `json:"custom_field_32" gorm:"type:text"`
+	CustomField33    string `json:"custom_field_33" gorm:"type:text"`
+	CustomField34    string `json:"custom_field_34" gorm:"type:text"`
+	CustomField35    string `json:"custom_field_35" gorm:"type:text"`
+	CustomField36    string `json:"custom_field_36" gorm:"type:text"`
+	CustomField37    string `json:"custom_field_37" gorm:"type:text"`
+	CustomField38    string `json:"custom_field_38" gorm:"type:text"`
+	CustomField39    string `json:"custom_field_39" gorm:"type:text"`
+	CustomField40    string `json:"custom_field_40" gorm:"type:text"`
+	CustomField41    string `json:"custom_field_41" gorm:"type:text"`
+	CustomField42    string `json:"custom_field_42" gorm:"type:text"`
+	CustomField43    string `json:"custom_field_43" gorm:"type:text"`
+	CustomField44    string `json:"custom_field_44" gorm:"type:text"`
+	CustomField45    string `json:"custom_field_45" gorm:"type:text"`
+	CustomField46    string `json:"custom_field_46" gorm:"type:text"`
+	CustomField47    string `json:"custom_field_47" gorm:"type:text"`
+	CustomField48    string `json:"custom_field_48" gorm:"type:text"`
+	CustomField49    string `json:"custom_field_49" gorm:"type:text"`
+	CustomField50    string `json:"custom_field_50" gorm:"type:text"`
+
+	archived.NoPKModel
 }
 
 func (TapdStory) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/story_bug.go b/plugins/tapd/models/migrationscripts/archived/story_bug.go
index b7f6e551..0adee911 100644
--- a/plugins/tapd/models/migrationscripts/archived/story_bug.go
+++ b/plugins/tapd/models/migrationscripts/archived/story_bug.go
@@ -17,16 +17,14 @@ limitations under the License.
 
 package archived
 
-import (
-	"github.com/apache/incubator-devlake/models/common"
-)
+import "github.com/apache/incubator-devlake/models/migrationscripts/archived"
 
 type TapdStoryBug struct {
 	ConnectionId uint64 `gorm:"primaryKey"`
 	WorkspaceId  uint64 `gorm:"primaryKey" json:"workspace_id,string"`
 	StoryId      uint64 `gorm:"primaryKey" json:"story_id,string"`
 	BugId        uint64 `gorm:"primaryKey" json:"bug_id,string"`
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdStoryBug) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/story_category.go b/plugins/tapd/models/migrationscripts/archived/story_category.go
index 5f7fe3b3..9eecd58f 100644
--- a/plugins/tapd/models/migrationscripts/archived/story_category.go
+++ b/plugins/tapd/models/migrationscripts/archived/story_category.go
@@ -18,7 +18,7 @@ limitations under the License.
 package archived
 
 import (
-	"github.com/apache/incubator-devlake/models/common"
+	"github.com/apache/incubator-devlake/models/migrationscripts/archived"
 	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
@@ -30,7 +30,7 @@ type TapdStoryCategory struct {
 	ParentId     uint64         `json:"parent_id,string"`
 	Created      helper.CSTTime `json:"created"`
 	Modified     helper.CSTTime `json:"modified"`
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdStoryCategory) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/story_changelog.go b/plugins/tapd/models/migrationscripts/archived/story_changelog.go
index 70e54b5b..4e50e93f 100644
--- a/plugins/tapd/models/migrationscripts/archived/story_changelog.go
+++ b/plugins/tapd/models/migrationscripts/archived/story_changelog.go
@@ -18,7 +18,7 @@ limitations under the License.
 package archived
 
 import (
-	"github.com/apache/incubator-devlake/models/common"
+	"github.com/apache/incubator-devlake/models/migrationscripts/archived"
 	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
@@ -34,7 +34,7 @@ type TapdStoryChangelog struct {
 	EntityType     string         `json:"entity_type" gorm:"type:varchar(255)"`
 	ChangeType     string         `json:"change_type" gorm:"type:varchar(255)"`
 	StoryId        uint64         `json:"story_id,string"`
-	common.NoPKModel
+	archived.NoPKModel
 	FieldChanges []TapdStoryChangelogItem `json:"field_changes" gorm:"-"`
 }
 
@@ -46,7 +46,7 @@ type TapdStoryChangelogItem struct {
 	ValueAfterParsed  string `json:"value_after_parsed"`
 	IterationIdFrom   uint64
 	IterationIdTo     uint64
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdStoryChangelog) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/story_commits.go b/plugins/tapd/models/migrationscripts/archived/story_commits.go
index 714747cf..20ffb961 100644
--- a/plugins/tapd/models/migrationscripts/archived/story_commits.go
+++ b/plugins/tapd/models/migrationscripts/archived/story_commits.go
@@ -18,7 +18,7 @@ limitations under the License.
 package archived
 
 import (
-	"github.com/apache/incubator-devlake/models/common"
+	"github.com/apache/incubator-devlake/models/migrationscripts/archived"
 	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
@@ -42,7 +42,7 @@ type TapdStoryCommit struct {
 	Created         *helper.CSTTime `json:"created"`
 
 	StoryId uint64
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdStoryCommit) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/story_custom_field.go b/plugins/tapd/models/migrationscripts/archived/story_custom_field.go
index 26eff16a..7c2502be 100644
--- a/plugins/tapd/models/migrationscripts/archived/story_custom_field.go
+++ b/plugins/tapd/models/migrationscripts/archived/story_custom_field.go
@@ -17,7 +17,7 @@ limitations under the License.
 
 package archived
 
-import "github.com/apache/incubator-devlake/models/common"
+import "github.com/apache/incubator-devlake/models/migrationscripts/archived"
 
 type TapdStoryCustomFields struct {
 	ConnectionId uint64 `gorm:"primaryKey;type:BIGINT  NOT NULL"`
@@ -30,7 +30,7 @@ type TapdStoryCustomFields struct {
 	Options      string `json:"options" gorm:"type:text"`
 	Enabled      string `json:"enabled" gorm:"type:varchar(255)"`
 	Sort         string `json:"sort" gorm:"type:varchar(255)"`
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdStoryCustomFields) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/story_label.go b/plugins/tapd/models/migrationscripts/archived/story_label.go
index f3c6ecdd..60b87ec1 100644
--- a/plugins/tapd/models/migrationscripts/archived/story_label.go
+++ b/plugins/tapd/models/migrationscripts/archived/story_label.go
@@ -17,14 +17,12 @@ limitations under the License.
 
 package archived
 
-import (
-	"github.com/apache/incubator-devlake/models/common"
-)
+import "github.com/apache/incubator-devlake/models/migrationscripts/archived"
 
 type TapdStoryLabel struct {
 	StoryId   uint64 `gorm:"primaryKey;autoIncrement:false"`
 	LabelName string `gorm:"primaryKey;type:varchar(255)"`
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdStoryLabel) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/story_status.go b/plugins/tapd/models/migrationscripts/archived/story_status.go
index 6100ddd4..b33ed3b1 100644
--- a/plugins/tapd/models/migrationscripts/archived/story_status.go
+++ b/plugins/tapd/models/migrationscripts/archived/story_status.go
@@ -17,9 +17,7 @@ limitations under the License.
 
 package archived
 
-import (
-	"github.com/apache/incubator-devlake/models/common"
-)
+import "github.com/apache/incubator-devlake/models/migrationscripts/archived"
 
 type TapdStoryStatus struct {
 	ConnectionId uint64 `gorm:"primaryKey"`
@@ -27,7 +25,7 @@ type TapdStoryStatus struct {
 	EnglishName  string `gorm:"primaryKey;type:varchar(255)"`
 	ChineseName  string
 	IsLastStep   bool
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdStoryStatus) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/task.go b/plugins/tapd/models/migrationscripts/archived/task.go
index af0b3339..2194111b 100644
--- a/plugins/tapd/models/migrationscripts/archived/task.go
+++ b/plugins/tapd/models/migrationscripts/archived/task.go
@@ -18,7 +18,7 @@ limitations under the License.
 package archived
 
 import (
-	"github.com/apache/incubator-devlake/models/common"
+	"github.com/apache/incubator-devlake/models/migrationscripts/archived"
 	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
@@ -109,7 +109,8 @@ type TapdTask struct {
 	CustomField48    string `json:"custom_field_48" gorm:"type:text"`
 	CustomField49    string `json:"custom_field_49" gorm:"type:text"`
 	CustomField50    string `json:"custom_field_50" gorm:"type:text"`
-	common.NoPKModel
+
+	archived.NoPKModel
 }
 
 func (TapdTask) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/task_changelog.go b/plugins/tapd/models/migrationscripts/archived/task_changelog.go
index 44ac8b78..2ee41065 100644
--- a/plugins/tapd/models/migrationscripts/archived/task_changelog.go
+++ b/plugins/tapd/models/migrationscripts/archived/task_changelog.go
@@ -18,7 +18,7 @@ limitations under the License.
 package archived
 
 import (
-	"github.com/apache/incubator-devlake/models/common"
+	"github.com/apache/incubator-devlake/models/migrationscripts/archived"
 	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
@@ -35,7 +35,7 @@ type TapdTaskChangelog struct {
 	ChangeType     string         `json:"change_type" gorm:"type:varchar(255)"`
 	ChangeTypeText string         `json:"change_type_text" gorm:"type:varchar(255)"`
 	TaskId         uint64         `json:"task_id,string"`
-	common.NoPKModel
+	archived.NoPKModel
 	FieldChanges []TapdTaskChangelogItem `json:"field_changes" gorm:"-"`
 }
 
@@ -47,7 +47,7 @@ type TapdTaskChangelogItem struct {
 	ValueAfterParsed  string `json:"value_after_parsed"`
 	IterationIdFrom   uint64
 	IterationIdTo     uint64
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdTaskChangelog) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/task_commits.go b/plugins/tapd/models/migrationscripts/archived/task_commits.go
index ec40f345..5067fbcd 100644
--- a/plugins/tapd/models/migrationscripts/archived/task_commits.go
+++ b/plugins/tapd/models/migrationscripts/archived/task_commits.go
@@ -18,7 +18,7 @@ limitations under the License.
 package archived
 
 import (
-	"github.com/apache/incubator-devlake/models/common"
+	"github.com/apache/incubator-devlake/models/migrationscripts/archived"
 	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
@@ -42,7 +42,7 @@ type TapdTaskCommit struct {
 	Created         *helper.CSTTime `json:"created"`
 
 	TaskId uint64
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdTaskCommit) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/task_custom_field.go b/plugins/tapd/models/migrationscripts/archived/task_custom_field.go
index ebd17cb6..59535268 100644
--- a/plugins/tapd/models/migrationscripts/archived/task_custom_field.go
+++ b/plugins/tapd/models/migrationscripts/archived/task_custom_field.go
@@ -17,7 +17,7 @@ limitations under the License.
 
 package archived
 
-import "github.com/apache/incubator-devlake/models/common"
+import "github.com/apache/incubator-devlake/models/migrationscripts/archived"
 
 type TapdTaskCustomFields struct {
 	ConnectionId uint64 `gorm:"primaryKey;type:BIGINT  NOT NULL"`
@@ -30,7 +30,7 @@ type TapdTaskCustomFields struct {
 	Options      string `json:"options" gorm:"type:text"`
 	Enabled      string `json:"enabled" gorm:"type:varchar(255)"`
 	Sort         string `json:"sort" gorm:"type:varchar(255)"`
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdTaskCustomFields) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/task_label.go b/plugins/tapd/models/migrationscripts/archived/task_label.go
index 9a001d6e..291ef01f 100644
--- a/plugins/tapd/models/migrationscripts/archived/task_label.go
+++ b/plugins/tapd/models/migrationscripts/archived/task_label.go
@@ -17,14 +17,12 @@ limitations under the License.
 
 package archived
 
-import (
-	"github.com/apache/incubator-devlake/models/common"
-)
+import "github.com/apache/incubator-devlake/models/migrationscripts/archived"
 
 type TapdTaskLabel struct {
 	TaskId    uint64 `gorm:"primaryKey;autoIncrement:false"`
 	LabelName string `gorm:"primaryKey;type:varchar(255)"`
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdTaskLabel) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/user.go b/plugins/tapd/models/migrationscripts/archived/user.go
index 62991b4e..4354048e 100644
--- a/plugins/tapd/models/migrationscripts/archived/user.go
+++ b/plugins/tapd/models/migrationscripts/archived/user.go
@@ -17,16 +17,14 @@ limitations under the License.
 
 package archived
 
-import (
-	"github.com/apache/incubator-devlake/models/common"
-)
+import "github.com/apache/incubator-devlake/models/migrationscripts/archived"
 
 type TapdUser struct {
 	ConnectionId uint64 `gorm:"primaryKey;type:BIGINT"`
 	WorkspaceId  uint64 `gorm:"primaryKey;type:BIGINT"`
 	Name         string `gorm:"index;type:varchar(255)" json:"name"`
 	User         string `gorm:"primaryKey;type:varchar(255)" json:"user"`
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdUser) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/worklog.go b/plugins/tapd/models/migrationscripts/archived/worklog.go
index f97ec921..e13188f2 100644
--- a/plugins/tapd/models/migrationscripts/archived/worklog.go
+++ b/plugins/tapd/models/migrationscripts/archived/worklog.go
@@ -18,7 +18,7 @@ limitations under the License.
 package archived
 
 import (
-	"github.com/apache/incubator-devlake/models/common"
+	"github.com/apache/incubator-devlake/models/migrationscripts/archived"
 	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
@@ -33,7 +33,7 @@ type TapdWorklog struct {
 	Owner        string          `gorm:"type:varchar(255)" json:"owner"`
 	Created      *helper.CSTTime `json:"created"`
 	Memo         string          `json:"memo" gorm:"type:text"`
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdWorklog) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/workspace.go b/plugins/tapd/models/migrationscripts/archived/workspace.go
index 9777fe13..fbb7bb18 100644
--- a/plugins/tapd/models/migrationscripts/archived/workspace.go
+++ b/plugins/tapd/models/migrationscripts/archived/workspace.go
@@ -18,7 +18,7 @@ limitations under the License.
 package archived
 
 import (
-	"github.com/apache/incubator-devlake/models/common"
+	"github.com/apache/incubator-devlake/models/migrationscripts/archived"
 	"github.com/apache/incubator-devlake/plugins/helper"
 )
 
@@ -36,14 +36,14 @@ type TapdWorkspace struct {
 	ParentId     uint64         `gorm:"type:BIGINT" json:"parent_id,string"`
 	Creator      string         `gorm:"type:varchar(255)" json:"creator"`
 	Created      helper.CSTTime `json:"created"`
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 type TapdWorkSpaceIssue struct {
 	ConnectionId uint64 `gorm:"primaryKey"`
 	WorkspaceId  uint64 `gorm:"primaryKey"`
 	IssueId      uint64 `gorm:"primaryKey"`
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdWorkspace) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/workspace_bug.go b/plugins/tapd/models/migrationscripts/archived/workspace_bug.go
index 6d61a97e..b79b4914 100644
--- a/plugins/tapd/models/migrationscripts/archived/workspace_bug.go
+++ b/plugins/tapd/models/migrationscripts/archived/workspace_bug.go
@@ -17,15 +17,13 @@ limitations under the License.
 
 package archived
 
-import (
-	"github.com/apache/incubator-devlake/models/common"
-)
+import "github.com/apache/incubator-devlake/models/migrationscripts/archived"
 
 type TapdWorkSpaceBug struct {
 	ConnectionId uint64 `gorm:"primaryKey"`
 	WorkspaceId  uint64 `gorm:"primaryKey"`
 	BugId        uint64 `gorm:"primaryKey"`
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdWorkSpaceBug) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/workspace_story.go b/plugins/tapd/models/migrationscripts/archived/workspace_story.go
index def8557f..1754dee3 100644
--- a/plugins/tapd/models/migrationscripts/archived/workspace_story.go
+++ b/plugins/tapd/models/migrationscripts/archived/workspace_story.go
@@ -17,15 +17,13 @@ limitations under the License.
 
 package archived
 
-import (
-	"github.com/apache/incubator-devlake/models/common"
-)
+import "github.com/apache/incubator-devlake/models/migrationscripts/archived"
 
 type TapdWorkSpaceStory struct {
 	ConnectionId uint64 `gorm:"primaryKey"`
 	WorkspaceId  uint64 `gorm:"primaryKey"`
 	StoryId      uint64 `gorm:"primaryKey"`
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdWorkSpaceStory) TableName() string {
diff --git a/plugins/tapd/models/migrationscripts/archived/workspace_task.go b/plugins/tapd/models/migrationscripts/archived/workspace_task.go
index d43aae21..9a240b5d 100644
--- a/plugins/tapd/models/migrationscripts/archived/workspace_task.go
+++ b/plugins/tapd/models/migrationscripts/archived/workspace_task.go
@@ -17,15 +17,13 @@ limitations under the License.
 
 package archived
 
-import (
-	"github.com/apache/incubator-devlake/models/common"
-)
+import "github.com/apache/incubator-devlake/models/migrationscripts/archived"
 
 type TapdWorkSpaceTask struct {
 	ConnectionId uint64 `gorm:"primaryKey"`
 	WorkspaceId  uint64 `gorm:"primaryKey"`
 	TaskId       uint64 `gorm:"primaryKey"`
-	common.NoPKModel
+	archived.NoPKModel
 }
 
 func (TapdWorkSpaceTask) TableName() string {