Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions backend/plugins/zentao/e2e/snapshot_tables/issues_bug.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id,url,icon_url,issue_key,title,description,epic_key,type,original_type,status,original_status,story_point,resolution_date,created_date,updated_date,lead_time_minutes,original_estimate_minutes,time_spent_minutes,time_remaining_minutes,creator_id,creator_name,assignee_id,assignee_name,parent_issue_id,priority,severity,urgency,component,is_subtask,due_date
zentao:ZentaoBug:1:1,http://iwater.red:8000/bug-view-1.html,,1,首页页面问题,,,BUG,bug,DONE,active,,,2012-06-05T02:56:11.000+00:00,2021-04-28T03:09:08.000+00:00,,,,,zentao:ZentaoAccount:1:7,测试甲,zentao:ZentaoAccount:1:4,开发甲,zentao:ZentaoStory:1:1,1,,,,0,
zentao:ZentaoBug:1:2,http://iwater.red:8000/bug-view-2.html,,2,新闻中心页面问题,,,BUG,bug,DONE,active,,,2012-06-05T02:57:11.000+00:00,2022-10-05T04:19:22.000+00:00,,,,,zentao:ZentaoAccount:1:7,测试甲,,,zentao:ZentaoStory:1:2,2,,,,0,2022-10-05T16:00:00.000+00:00
zentao:ZentaoBug:1:3,http://iwater.red:8000/bug-view-3.html,,3,成果展示页面问题,,,BUG,bug,DONE,active,,,2012-06-05T02:58:22.000+00:00,2021-04-28T03:09:08.000+00:00,,,,,zentao:ZentaoAccount:1:8,测试乙,zentao:ZentaoAccount:1:4,开发甲,zentao:ZentaoStory:1:3,1,,,,0,
zentao:ZentaoBug:1:4,http://iwater.red:8000/bug-view-4.html,,4,售后服务页面问题,,,BUG,bug,resolved,resolved,,,2012-06-05T03:00:19.000+00:00,2022-10-05T04:10:08.000+00:00,,,,,zentao:ZentaoAccount:1:9,测试丙,zentao:ZentaoAccount:1:9,测试丙,zentao:ZentaoStory:1:4,1,,,,0,
zentao:ZentaoBug:1:5,http://iwater.red:8000/bug-view-5.html,,5,首页页面问题,,,BUG,bug,DONE,active,,,2012-06-05T02:56:11.000+00:00,2021-04-28T03:09:08.000+00:00,,,,,zentao:ZentaoAccount:1:7,测试甲,zentao:ZentaoAccount:1:4,开发甲,zentao:ZentaoStory:1:1,1,,,,0,
zentao:ZentaoBug:1:6,http://iwater.red:8000/bug-view-6.html,,6,新闻中心页面问题,,,BUG,bug,DONE,active,,,2012-06-05T02:57:11.000+00:00,2022-10-05T04:19:22.000+00:00,,,,,zentao:ZentaoAccount:1:7,测试甲,,,zentao:ZentaoStory:1:2,2,,,,0,2022-10-05T16:00:00.000+00:00
zentao:ZentaoBug:1:1,http://iwater.red:8000/bug-view-1.html,,1,首页页面问题,,,BUG,bug,DONE,active,,,2012-06-05T02:56:11.000+00:00,2021-04-28T03:09:08.000+00:00,,,,,zentao:ZentaoAccount:1:7,测试甲,zentao:ZentaoAccount:1:4,开发甲,zentao:ZentaoStory:1:1,1,3,,,0,
zentao:ZentaoBug:1:2,http://iwater.red:8000/bug-view-2.html,,2,新闻中心页面问题,,,BUG,bug,DONE,active,,,2012-06-05T02:57:11.000+00:00,2022-10-05T04:19:22.000+00:00,,,,,zentao:ZentaoAccount:1:7,测试甲,,,zentao:ZentaoStory:1:2,2,3,,,0,2022-10-05T16:00:00.000+00:00
zentao:ZentaoBug:1:3,http://iwater.red:8000/bug-view-3.html,,3,成果展示页面问题,,,BUG,bug,DONE,active,,,2012-06-05T02:58:22.000+00:00,2021-04-28T03:09:08.000+00:00,,,,,zentao:ZentaoAccount:1:8,测试乙,zentao:ZentaoAccount:1:4,开发甲,zentao:ZentaoStory:1:3,1,3,,,0,
zentao:ZentaoBug:1:4,http://iwater.red:8000/bug-view-4.html,,4,售后服务页面问题,,,BUG,bug,resolved,resolved,,,2012-06-05T03:00:19.000+00:00,2022-10-05T04:10:08.000+00:00,,,,,zentao:ZentaoAccount:1:9,测试丙,zentao:ZentaoAccount:1:9,测试丙,zentao:ZentaoStory:1:4,1,3,,,0,
zentao:ZentaoBug:1:5,http://iwater.red:8000/bug-view-5.html,,5,首页页面问题,,,BUG,bug,DONE,active,,,2012-06-05T02:56:11.000+00:00,2021-04-28T03:09:08.000+00:00,,,,,zentao:ZentaoAccount:1:7,测试甲,zentao:ZentaoAccount:1:4,开发甲,zentao:ZentaoStory:1:1,1,3,,,0,
zentao:ZentaoBug:1:6,http://iwater.red:8000/bug-view-6.html,,6,新闻中心页面问题,,,BUG,bug,DONE,active,,,2012-06-05T02:57:11.000+00:00,2022-10-05T04:19:22.000+00:00,,,,,zentao:ZentaoAccount:1:7,测试甲,,,zentao:ZentaoStory:1:2,2,3,,,0,2022-10-05T16:00:00.000+00:00
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
id,url,icon_url,issue_key,title,description,epic_key,type,original_type,status,original_status,story_point,resolution_date,created_date,updated_date,lead_time_minutes,original_estimate_minutes,time_spent_minutes,time_remaining_minutes,creator_id,creator_name,assignee_id,assignee_name,parent_issue_id,priority,severity,urgency,component,is_subtask,due_date
zentao:ZentaoBug:1:4,http://iwater.red:8000/bug-view-4.html,,4,售后服务页面问题,,,BUG,bug,resolved,resolved,,2022-10-05T04:09:59.000+00:00,2012-06-05T03:00:19.000+00:00,2022-10-05T04:10:08.000+00:00,5434629,,,,zentao:ZentaoAccount:1:9,测试丙,zentao:ZentaoAccount:1:9,测试丙,zentao:ZentaoStory:1:4,1,,,,0,2022-10-05T04:09:59.000+00:00
zentao:ZentaoBug:1:4,http://iwater.red:8000/bug-view-4.html,,4,售后服务页面问题,,,BUG,bug,resolved,resolved,,2022-10-05T04:09:59.000+00:00,2012-06-05T03:00:19.000+00:00,2022-10-05T04:10:08.000+00:00,5434629,,,,zentao:ZentaoAccount:1:9,测试丙,zentao:ZentaoAccount:1:9,测试丙,zentao:ZentaoStory:1:4,1,3,,,0,2022-10-05T04:09:59.000+00:00
2 changes: 1 addition & 1 deletion backend/plugins/zentao/tasks/bug_convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func ConvertBug(taskCtx plugin.SubTaskContext) errors.Error {
Priority: getPriority(toolEntity.Pri),
CreatorName: toolEntity.OpenedByName,
AssigneeName: toolEntity.AssignedToName,
Severity: string(rune(toolEntity.Severity)),
Severity: getSeverity(toolEntity.Severity),
Url: convertIssueURL(toolEntity.Url, "bug", toolEntity.ID),
OriginalProject: getOriginalProject(data),
Status: toolEntity.StdStatus,
Expand Down
6 changes: 6 additions & 0 deletions backend/plugins/zentao/tasks/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"path"
"reflect"
"regexp"
"strconv"
"strings"

"github.com/apache/devlake/core/dal"
Expand Down Expand Up @@ -80,6 +81,11 @@ func getPriority(pri int) string {
*/
}

// getSeverity formats the numeric zentao bug severity (e.g. 3) as its decimal string ("3")
func getSeverity(severity int) string {
return strconv.Itoa(severity)
}

func getOriginalProject(data *ZentaoTaskData) string {
if data.Options.ProjectId != 0 {
return data.ProjectName
Expand Down
17 changes: 17 additions & 0 deletions backend/plugins/zentao/tasks/shared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,20 @@ func Test_getZentaoWebURL(t *testing.T) {
})
}
}

func Test_getSeverity(t *testing.T) {
tests := []struct {
severity int
want string
}{
{1, "1"},
{3, "3"},
{4, "4"},
{10, "10"},
}
for _, tt := range tests {
if got := getSeverity(tt.severity); got != tt.want {
t.Errorf("getSeverity(%d) = %q, want %q", tt.severity, got, tt.want)
}
}
}
Loading