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

zhangliang2022 pushed a commit to branch release-v0.18
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/release-v0.18 by this push:
     new 5db057723 fix: zentao status mapping (#5774) (#5775)
5db057723 is described below

commit 5db057723370747d3f9e16cafede12abd911bfbe
Author: Liang Zhang <[email protected]>
AuthorDate: Fri Jul 28 19:57:16 2023 +0800

    fix: zentao status mapping (#5774) (#5775)
    
    * fix: zentao status mapping
    
    * fix: e2e test
---
 .../zentao/e2e/snapshot_tables/_tool_zentao_bugs.csv   |  6 +++---
 .../e2e/snapshot_tables/_tool_zentao_stories.csv       | 18 +++++++++---------
 .../plugins/zentao/e2e/snapshot_tables/issues_bug.csv  | 12 ++++++------
 .../zentao/e2e/snapshot_tables/issues_story.csv        | 18 +++++++++---------
 .../plugins/zentao/e2e/snapshot_tables/issues_task.csv |  6 +++---
 backend/plugins/zentao/tasks/bug_convertor.go          |  2 +-
 backend/plugins/zentao/tasks/bug_extractor.go          |  6 +++++-
 backend/plugins/zentao/tasks/story_convertor.go        |  2 +-
 backend/plugins/zentao/tasks/story_extractor.go        |  6 +++++-
 backend/plugins/zentao/tasks/task_convertor.go         |  2 +-
 backend/plugins/zentao/tasks/task_extractor.go         |  6 +++++-
 11 files changed, 48 insertions(+), 36 deletions(-)

diff --git a/backend/plugins/zentao/e2e/snapshot_tables/_tool_zentao_bugs.csv 
b/backend/plugins/zentao/e2e/snapshot_tables/_tool_zentao_bugs.csv
index b9464cbae..6efd60f0b 100644
--- a/backend/plugins/zentao/e2e/snapshot_tables/_tool_zentao_bugs.csv
+++ b/backend/plugins/zentao/e2e/snapshot_tables/_tool_zentao_bugs.csv
@@ -4,16 +4,16 @@ 
connection_id,id,project,product,injection,identify,branch,module,execution,plan
 
<p>[期望]正常显示</p>",active,,,0,0,,,,7,测试甲,2012-06-05T02:56:11.000+00:00,主干,4,开发甲,2012-06-05T02:56:11.000+00:00,,0,,,,0,,0,,0,0,0,0,,,,,,,0,0,2021-04-28T03:09:08.000+00:00,0,1,3,0,激活,normal,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,DONE,CODE_ERROR
 
1,2,1,3,0,0,0,9,1,1,2,1,15,0,0,新闻中心页面问题,hh,3,2,codeerror,",windows",",chrome",,,"<p>[步骤]进入新闻中心</p>
 <p>[结果]页面出现乱码</p>
-<p>[期望]正常显示rew</p>",delay,,,1,1,2022-10-05T04:16:44.000+00:00,,[email protected],7,测试甲,2012-06-05T02:57:11.000+00:00,主干,0,,2022-10-05T04:19:22.000+00:00,2022-10-06,0,,,,0,,0,,0,0,0,0,,,,,,,1,1,2022-10-05T04:19:22.000+00:00,0,2,3,0,过期Bug,normal,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,,CODE_ERROR
+<p>[期望]正常显示rew</p>",active,,,1,1,2022-10-05T04:16:44.000+00:00,,[email protected],7,测试甲,2012-06-05T02:57:11.000+00:00,主干,0,,2022-10-05T04:19:22.000+00:00,2022-10-06,0,,,,0,,0,,0,0,0,0,,,,,,,1,1,2022-10-05T04:19:22.000+00:00,0,2,3,0,过期Bug,normal,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,DONE,CODE_ERROR
 
1,3,1,3,0,0,0,10,1,0,3,2,6,0,0,成果展示页面问题,,3,1,codeerror,,,,,"<p>[步骤]进入成果展示&nbsp;&nbsp;&nbsp;&nbsp;</p>
 <p>[结果]乱码</p>
 
<p>[期望]正常显示</p>",active,,,0,0,,,,8,测试乙,2012-06-05T02:58:22.000+00:00,主干,4,开发甲,2012-06-05T02:58:22.000+00:00,,0,,,,0,,0,,0,0,0,0,,,,,,,0,0,2021-04-28T03:09:08.000+00:00,0,1,3,0,激活,normal,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,DONE,CODE_ERROR
 1,4,1,3,0,0,0,11,1,0,4,1,9,0,0,售后服务页面问题,,3,1,codeerror,,,,,"<p>[步骤]进入售后服务</p>
 <p>[结果]乱码</p>
-<p>[期望]正常显示</p>",resolved,,,1,0,,,,9,测试丙,2012-06-05T03:00:19.000+00:00,主干,9,测试丙,2022-10-05T04:10:08.000+00:00,,1,fixed,主干,2022-10-05T04:09:59.000+00:00,0,,0,,0,0,0,0,,,,,,,0,1,2022-10-05T04:10:08.000+00:00,0,1,3,0,已解决,normal,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,,CODE_ERROR
+<p>[期望]正常显示</p>",resolved,,,1,0,,,,9,测试丙,2012-06-05T03:00:19.000+00:00,主干,9,测试丙,2022-10-05T04:10:08.000+00:00,,1,fixed,主干,2022-10-05T04:09:59.000+00:00,0,,0,,0,0,0,0,,,,,,,0,1,2022-10-05T04:10:08.000+00:00,0,1,3,0,已解决,normal,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,resolved,CODE_ERROR
 1,5,1,3,0,0,0,8,1,0,1,1,1,0,0,首页页面问题,,3,1,codeerror,,,,,"<p>[步骤]进入首页</p>
 <p>[结果]出现乱码&nbsp;&nbsp;&nbsp;&nbsp;</p>
 
<p>[期望]正常显示</p>",active,,,0,0,,,,7,测试甲,2012-06-05T02:56:11.000+00:00,主干,4,开发甲,2012-06-05T02:56:11.000+00:00,,0,,,,0,,0,,0,0,0,0,,,,,,,0,0,2021-04-28T03:09:08.000+00:00,0,1,3,0,激活,normal,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,DONE,CODE_ERROR
 
1,6,1,3,0,0,0,9,1,1,2,1,15,0,0,新闻中心页面问题,hh,3,2,codeerror,",windows",",chrome",,,"<p>[步骤]进入新闻中心</p>
 <p>[结果]页面出现乱码</p>
-<p>[期望]正常显示rew</p>",delay,,,1,1,2022-10-05T04:16:44.000+00:00,,[email protected],7,测试甲,2012-06-05T02:57:11.000+00:00,主干,0,,2022-10-05T04:19:22.000+00:00,2022-10-06,0,,,,0,,0,,0,0,0,0,,,,,,,1,1,2022-10-05T04:19:22.000+00:00,0,2,3,0,过期Bug,normal,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,,CODE_ERROR
+<p>[期望]正常显示rew</p>",active,,,1,1,2022-10-05T04:16:44.000+00:00,,[email protected],7,测试甲,2012-06-05T02:57:11.000+00:00,主干,0,,2022-10-05T04:19:22.000+00:00,2022-10-06,0,,,,0,,0,,0,0,0,0,,,,,,,1,1,2022-10-05T04:19:22.000+00:00,0,2,3,0,过期Bug,normal,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,DONE,CODE_ERROR
diff --git 
a/backend/plugins/zentao/e2e/snapshot_tables/_tool_zentao_stories.csv 
b/backend/plugins/zentao/e2e/snapshot_tables/_tool_zentao_stories.csv
index 7ec8e5fa1..57f3f4bbf 100644
--- a/backend/plugins/zentao/e2e/snapshot_tables/_tool_zentao_stories.csv
+++ b/backend/plugins/zentao/e2e/snapshot_tables/_tool_zentao_stories.csv
@@ -1,10 +1,10 @@
 
connection_id,id,product,branch,version,order_in,vision,parent,module,plan,source,source_note,from_bug,feedback,title,keywords,type,category,pri,estimate,status,sub_status,color,stage,lib,from_story,from_version,opened_by_id,opened_by_name,opened_date,assigned_to_id,assigned_to_name,assigned_date,approved_date,last_edited_id,last_edited_date,changed_date,reviewed_by_id,reviewed_date,closed_id,closed_date,closed_reason,activated_date,to_bug,child_stories,link_stories,link_requirements,dup
 [...]
-1,1,3,0,1,0,rnd,0,1,1,po,,0,0,首页设计和开发,,story,feature,1,1,active,,,developing,0,0,1,2,产品经理,2012-06-05T02:09:49.000+00:00,2,产品经理,,,2,2012-06-05T02:25:19.000+00:00,,0,2012-06-04T16:00:00.000+00:00,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 ,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,REQUIRE
-1,2,3,0,1,0,rnd,0,2,1,po,,0,0,新闻中心的设计和开发。,,story,feature,1,1,active,,,projected,0,0,1,2,产品经理,2012-06-05T02:16:37.000+00:00,2,产品经理,2012-06-05T02:16:37.000+00:00,,2,2012-06-05T02:25:33.000+00:00,,0,2012-06-04T16:00:00.000+00:00,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 ,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,REQUIRE
-1,3,3,0,2,0,rnd,0,3,1,po,,0,0,成果展示的设计和开发,,story,feature,1,0,active,,,developing,0,0,1,2,产品经理,2012-06-05T02:18:10.000+00:00,2,产品经理,2012-06-05T02:18:10.000+00:00,,2,2012-06-05T02:25:38.000+00:00,,0,2012-06-04T16:00:00.000+00:00,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 ,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,REQUIRE
-1,4,3,0,1,0,rnd,0,4,1,po,,0,0,售后服务的设计和开发,,story,feature,1,1,active,,,developed,0,0,1,2,产品经理,2012-06-05T02:20:16.000+00:00,2,产品经理,2012-06-05T02:20:16.000+00:00,,2,2012-06-05T02:25:42.000+00:00,,0,2012-06-04T16:00:00.000+00:00,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 ,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,REQUIRE
-1,5,3,0,1,0,rnd,0,5,1,po,,0,0,诚聘英才的设计和开发,,story,feature,1,1,reviewing,,,planned,0,0,1,2,产品经理,2012-06-05T02:21:39.000+00:00,2,产品经理,2012-06-05T02:21:39.000+00:00,,0,,,0,,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 ,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,REQUIRE
-1,6,3,0,1,0,rnd,0,6,1,po,,0,0,合作洽谈的设计和开发,,story,feature,1,1,reviewing,,,planned,0,0,1,2,产品经理,2012-06-05T02:23:11.000+00:00,2,产品经理,2012-06-05T02:23:11.000+00:00,,0,,,0,,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 ,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,REQUIRE
-1,7,3,0,1,0,rnd,0,7,1,po,,0,0,关于我们的设计和开发,,story,feature,1,1,reviewing,,,planned,0,0,1,2,产品经理,2012-06-05T02:24:19.000+00:00,2,产品经理,2012-06-05T02:24:19.000+00:00,,0,,,0,,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 ,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,REQUIRE
-1,8,3,0,1,0,rnd,0,2,1,po,,0,0,新闻中心的设计和开发。,,story,feature,1,1,active,,,projected,0,0,1,2,产品经理,2012-06-05T02:16:37.000+00:00,2,产品经理,2012-06-05T02:16:37.000+00:00,,2,2012-06-05T02:25:33.000+00:00,,0,2012-06-04T16:00:00.000+00:00,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 ,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,REQUIRE
-1,9,3,0,1,0,rnd,0,1,1,po,,0,0,首页设计和开发,,story,feature,1,1,active,,,developing,0,0,1,2,产品经理,2012-06-05T02:09:49.000+00:00,2,产品经理,,,2,2012-06-05T02:25:19.000+00:00,,0,2012-06-04T16:00:00.000+00:00,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 ,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,REQUIRE
+1,1,3,0,1,0,rnd,0,1,1,po,,0,0,首页设计和开发,,story,feature,1,1,active,,,developing,0,0,1,2,产品经理,2012-06-05T02:09:49.000+00:00,2,产品经理,,,2,2012-06-05T02:25:19.000+00:00,,0,2012-06-04T16:00:00.000+00:00,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 
,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,DONE,REQUIREMENT
+1,2,3,0,1,0,rnd,0,2,1,po,,0,0,新闻中心的设计和开发。,,story,feature,1,1,active,,,projected,0,0,1,2,产品经理,2012-06-05T02:16:37.000+00:00,2,产品经理,2012-06-05T02:16:37.000+00:00,,2,2012-06-05T02:25:33.000+00:00,,0,2012-06-04T16:00:00.000+00:00,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 
,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,DONE,REQUIREMENT
+1,3,3,0,2,0,rnd,0,3,1,po,,0,0,成果展示的设计和开发,,story,feature,1,0,active,,,developing,0,0,1,2,产品经理,2012-06-05T02:18:10.000+00:00,2,产品经理,2012-06-05T02:18:10.000+00:00,,2,2012-06-05T02:25:38.000+00:00,,0,2012-06-04T16:00:00.000+00:00,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 
,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,DONE,REQUIREMENT
+1,4,3,0,1,0,rnd,0,4,1,po,,0,0,售后服务的设计和开发,,story,feature,1,1,active,,,developed,0,0,1,2,产品经理,2012-06-05T02:20:16.000+00:00,2,产品经理,2012-06-05T02:20:16.000+00:00,,2,2012-06-05T02:25:42.000+00:00,,0,2012-06-04T16:00:00.000+00:00,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 
,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,DONE,REQUIREMENT
+1,5,3,0,1,0,rnd,0,5,1,po,,0,0,诚聘英才的设计和开发,,story,feature,1,1,reviewing,,,planned,0,0,1,2,产品经理,2012-06-05T02:21:39.000+00:00,2,产品经理,2012-06-05T02:21:39.000+00:00,,0,,,0,,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 
,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,reviewing,REQUIREMENT
+1,6,3,0,1,0,rnd,0,6,1,po,,0,0,合作洽谈的设计和开发,,story,feature,1,1,reviewing,,,planned,0,0,1,2,产品经理,2012-06-05T02:23:11.000+00:00,2,产品经理,2012-06-05T02:23:11.000+00:00,,0,,,0,,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 
,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,reviewing,REQUIREMENT
+1,7,3,0,1,0,rnd,0,7,1,po,,0,0,关于我们的设计和开发,,story,feature,1,1,reviewing,,,planned,0,0,1,2,产品经理,2012-06-05T02:24:19.000+00:00,2,产品经理,2012-06-05T02:24:19.000+00:00,,0,,,0,,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 
,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,reviewing,REQUIREMENT
+1,8,3,0,1,0,rnd,0,2,1,po,,0,0,新闻中心的设计和开发。,,story,feature,1,1,active,,,projected,0,0,1,2,产品经理,2012-06-05T02:16:37.000+00:00,2,产品经理,2012-06-05T02:16:37.000+00:00,,2,2012-06-05T02:25:33.000+00:00,,0,2012-06-04T16:00:00.000+00:00,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 
,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,DONE,REQUIREMENT
+1,9,3,0,1,0,rnd,0,1,1,po,,0,0,首页设计和开发,,story,feature,1,1,active,,,developing,0,0,1,2,产品经理,2012-06-05T02:09:49.000+00:00,2,产品经理,,,2,2012-06-05T02:25:19.000+00:00,,0,2012-06-04T16:00:00.000+00:00,0,,,,0,,,,0,0,,,0,0,1,1.0版本
 
,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,DONE,REQUIREMENT
diff --git a/backend/plugins/zentao/e2e/snapshot_tables/issues_bug.csv 
b/backend/plugins/zentao/e2e/snapshot_tables/issues_bug.csv
index ad377e04b..c3df8f609 100644
--- a/backend/plugins/zentao/e2e/snapshot_tables/issues_bug.csv
+++ b/backend/plugins/zentao/e2e/snapshot_tables/issues_bug.csv
@@ -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,parent_issue_id,priority,original_estimate_minutes,time_spent_minutes,time_remaining_minutes,creator_id,creator_name,assignee_id,assignee_name,severity,component
-zentao:ZentaoBug:1:1,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,,1,首页页面问题,,,BUG,codeerror,DONE,active,0,,2012-06-05T02:56:11.000+00:00,2021-04-28T03:09:08.000+00:00,0,zentao:ZentaoStory:1:1,1,0,0,0,zentao:ZentaoAccount:1:7,测试甲,zentao:ZentaoAccount:1:4,开发甲,,
-zentao:ZentaoBug:1:2,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,,2,新闻中心页面问题,,,BUG,codeerror,,delay,0,,2012-06-05T02:57:11.000+00:00,2022-10-05T04:19:22.000+00:00,0,zentao:ZentaoStory:1:2,2,0,0,0,zentao:ZentaoAccount:1:7,测试甲,,,,
-zentao:ZentaoBug:1:3,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,,3,成果展示页面问题,,,BUG,codeerror,DONE,active,0,,2012-06-05T02:58:22.000+00:00,2021-04-28T03:09:08.000+00:00,0,zentao:ZentaoStory:1:3,1,0,0,0,zentao:ZentaoAccount:1:8,测试乙,zentao:ZentaoAccount:1:4,开发甲,,
-zentao:ZentaoBug:1:4,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,,4,售后服务页面问题,,,BUG,codeerror,,resolved,0,,2012-06-05T03:00:19.000+00:00,2022-10-05T04:10:08.000+00:00,0,zentao:ZentaoStory:1:4,1,0,0,0,zentao:ZentaoAccount:1:9,测试丙,zentao:ZentaoAccount:1:9,测试丙,,
-zentao:ZentaoBug:1:5,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,,5,首页页面问题,,,BUG,codeerror,DONE,active,0,,2012-06-05T02:56:11.000+00:00,2021-04-28T03:09:08.000+00:00,0,zentao:ZentaoStory:1:1,1,0,0,0,zentao:ZentaoAccount:1:7,测试甲,zentao:ZentaoAccount:1:4,开发甲,,
-zentao:ZentaoBug:1:6,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,,6,新闻中心页面问题,,,BUG,codeerror,,delay,0,,2012-06-05T02:57:11.000+00:00,2022-10-05T04:19:22.000+00:00,0,zentao:ZentaoStory:1:2,2,0,0,0,zentao:ZentaoAccount:1:7,测试甲,,,,
+zentao:ZentaoBug:1:1,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,,1,首页页面问题,,,CODE_ERROR,bug,DONE,active,0,,2012-06-05T02:56:11.000+00:00,2021-04-28T03:09:08.000+00:00,0,zentao:ZentaoStory:1:1,1,0,0,0,zentao:ZentaoAccount:1:7,测试甲,zentao:ZentaoAccount:1:4,开发甲,,
+zentao:ZentaoBug:1:2,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,,2,新闻中心页面问题,,,CODE_ERROR,bug,DONE,active,0,,2012-06-05T02:57:11.000+00:00,2022-10-05T04:19:22.000+00:00,0,zentao:ZentaoStory:1:2,2,0,0,0,zentao:ZentaoAccount:1:7,测试甲,,,,
+zentao:ZentaoBug:1:3,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,,3,成果展示页面问题,,,CODE_ERROR,bug,DONE,active,0,,2012-06-05T02:58:22.000+00:00,2021-04-28T03:09:08.000+00:00,0,zentao:ZentaoStory:1:3,1,0,0,0,zentao:ZentaoAccount:1:8,测试乙,zentao:ZentaoAccount:1:4,开发甲,,
+zentao:ZentaoBug:1:4,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,,4,售后服务页面问题,,,CODE_ERROR,bug,resolved,resolved,0,,2012-06-05T03:00:19.000+00:00,2022-10-05T04:10:08.000+00:00,0,zentao:ZentaoStory:1:4,1,0,0,0,zentao:ZentaoAccount:1:9,测试丙,zentao:ZentaoAccount:1:9,测试丙,,
+zentao:ZentaoBug:1:5,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,,5,首页页面问题,,,CODE_ERROR,bug,DONE,active,0,,2012-06-05T02:56:11.000+00:00,2021-04-28T03:09:08.000+00:00,0,zentao:ZentaoStory:1:1,1,0,0,0,zentao:ZentaoAccount:1:7,测试甲,zentao:ZentaoAccount:1:4,开发甲,,
+zentao:ZentaoBug:1:6,http://iwater.red:8000/api.php/v1/products/1/bugs?limit=100&page=1,,6,新闻中心页面问题,,,CODE_ERROR,bug,DONE,active,0,,2012-06-05T02:57:11.000+00:00,2022-10-05T04:19:22.000+00:00,0,zentao:ZentaoStory:1:2,2,0,0,0,zentao:ZentaoAccount:1:7,测试甲,,,,
diff --git a/backend/plugins/zentao/e2e/snapshot_tables/issues_story.csv 
b/backend/plugins/zentao/e2e/snapshot_tables/issues_story.csv
index addcc6a60..b47f41514 100644
--- a/backend/plugins/zentao/e2e/snapshot_tables/issues_story.csv
+++ b/backend/plugins/zentao/e2e/snapshot_tables/issues_story.csv
@@ -1,10 +1,10 @@
 
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,parent_issue_id,priority,original_estimate_minutes,time_spent_minutes,time_remaining_minutes,creator_id,creator_name,assignee_id,assignee_name,severity,component
-zentao:ZentaoStory:1:1,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,1,首页设计和开发,,,REQUIREMENT,story.feature,,active,0,,2012-06-05T02:09:49.000+00:00,2012-06-05T02:25:19.000+00:00,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
-zentao:ZentaoStory:1:2,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,2,新闻中心的设计和开发。,,,REQUIREMENT,story.feature,,active,0,,2012-06-05T02:16:37.000+00:00,2012-06-05T02:25:33.000+00:00,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
-zentao:ZentaoStory:1:3,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,3,成果展示的设计和开发,,,REQUIREMENT,story.feature,,active,0,,2012-06-05T02:18:10.000+00:00,2012-06-05T02:25:38.000+00:00,0,,1,0,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
-zentao:ZentaoStory:1:4,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,4,售后服务的设计和开发,,,REQUIREMENT,story.feature,,active,0,,2012-06-05T02:20:16.000+00:00,2012-06-05T02:25:42.000+00:00,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
-zentao:ZentaoStory:1:5,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,5,诚聘英才的设计和开发,,,REQUIREMENT,story.feature,,reviewing,0,,2012-06-05T02:21:39.000+00:00,,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
-zentao:ZentaoStory:1:6,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,6,合作洽谈的设计和开发,,,REQUIREMENT,story.feature,,reviewing,0,,2012-06-05T02:23:11.000+00:00,,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
-zentao:ZentaoStory:1:7,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,7,关于我们的设计和开发,,,REQUIREMENT,story.feature,,reviewing,0,,2012-06-05T02:24:19.000+00:00,,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
-zentao:ZentaoStory:1:8,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,8,新闻中心的设计和开发。,,,REQUIREMENT,story.feature,,active,0,,2012-06-05T02:16:37.000+00:00,2012-06-05T02:25:33.000+00:00,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
-zentao:ZentaoStory:1:9,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,9,首页设计和开发,,,REQUIREMENT,story.feature,,active,0,,2012-06-05T02:09:49.000+00:00,2012-06-05T02:25:19.000+00:00,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
+zentao:ZentaoStory:1:1,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,1,首页设计和开发,,,REQUIREMENT,story,DONE,active,0,,2012-06-05T02:09:49.000+00:00,2012-06-05T02:25:19.000+00:00,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
+zentao:ZentaoStory:1:2,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,2,新闻中心的设计和开发。,,,REQUIREMENT,story,DONE,active,0,,2012-06-05T02:16:37.000+00:00,2012-06-05T02:25:33.000+00:00,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
+zentao:ZentaoStory:1:3,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,3,成果展示的设计和开发,,,REQUIREMENT,story,DONE,active,0,,2012-06-05T02:18:10.000+00:00,2012-06-05T02:25:38.000+00:00,0,,1,0,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
+zentao:ZentaoStory:1:4,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,4,售后服务的设计和开发,,,REQUIREMENT,story,DONE,active,0,,2012-06-05T02:20:16.000+00:00,2012-06-05T02:25:42.000+00:00,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
+zentao:ZentaoStory:1:5,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,5,诚聘英才的设计和开发,,,REQUIREMENT,story,reviewing,reviewing,0,,2012-06-05T02:21:39.000+00:00,,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
+zentao:ZentaoStory:1:6,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,6,合作洽谈的设计和开发,,,REQUIREMENT,story,reviewing,reviewing,0,,2012-06-05T02:23:11.000+00:00,,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
+zentao:ZentaoStory:1:7,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,7,关于我们的设计和开发,,,REQUIREMENT,story,reviewing,reviewing,0,,2012-06-05T02:24:19.000+00:00,,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
+zentao:ZentaoStory:1:8,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,8,新闻中心的设计和开发。,,,REQUIREMENT,story,DONE,active,0,,2012-06-05T02:16:37.000+00:00,2012-06-05T02:25:33.000+00:00,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
+zentao:ZentaoStory:1:9,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,9,首页设计和开发,,,REQUIREMENT,story,DONE,active,0,,2012-06-05T02:09:49.000+00:00,2012-06-05T02:25:19.000+00:00,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
diff --git a/backend/plugins/zentao/e2e/snapshot_tables/issues_task.csv 
b/backend/plugins/zentao/e2e/snapshot_tables/issues_task.csv
index fd57b3b8a..8ac7954a8 100644
--- a/backend/plugins/zentao/e2e/snapshot_tables/issues_task.csv
+++ b/backend/plugins/zentao/e2e/snapshot_tables/issues_task.csv
@@ -1,4 +1,4 @@
 
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,parent_issue_id,priority,original_estimate_minutes,time_spent_minutes,time_remaining_minutes,creator_id,creator_name,assignee_id,assignee_name,severity,component
-zentao:ZentaoTask:1:1,http://iwater.red:8000/api.php/v1/executions/9/tasks?limit=100&page=1,,1,任务名称,任务描述<span>
 </span><br /><div><br 
/></div>,,TASK,devel.,IN_PROGRESS,wait,0,,2022-09-19T01:50:37.000+00:00,,0,,3,0,0,0,zentao:ZentaoAccount:1:1,devlake,zentao:ZentaoAccount:1:5,开发乙,,
-zentao:ZentaoTask:1:2,http://iwater.red:8000/api.php/v1/executions/4/tasks?limit=100&page=1,,2,任务名称,任务描述<span>
 </span><br /><div><br 
/></div>,,TASK,devel.,IN_PROGRESS,wait,0,,2022-09-19T01:50:37.000+00:00,,0,,3,720,120,600,zentao:ZentaoAccount:1:1,devlake,zentao:ZentaoAccount:1:5,开发乙,,
-zentao:ZentaoTask:1:3,http://iwater.red:8000/api.php/v1/executions/3/tasks?limit=100&page=1,,3,任务名称,任务描述<span>
 </span><br /><div><br 
/></div>,,TASK,devel.,IN_PROGRESS,wait,0,,2022-09-19T01:50:37.000+00:00,,0,zentao:ZentaoStory:1:-1,3,660,0,660,zentao:ZentaoAccount:1:1,devlake,zentao:ZentaoAccount:1:5,开发乙,,
+zentao:ZentaoTask:1:1,http://iwater.red:8000/api.php/v1/executions/9/tasks?limit=100&page=1,,1,任务名称,任务描述<span>
 </span><br /><div><br 
/></div>,,TASK_DEV,task,IN_PROGRESS,wait,0,,2022-09-19T01:50:37.000+00:00,,0,,3,0,0,0,zentao:ZentaoAccount:1:1,devlake,zentao:ZentaoAccount:1:5,开发乙,,
+zentao:ZentaoTask:1:2,http://iwater.red:8000/api.php/v1/executions/4/tasks?limit=100&page=1,,2,任务名称,任务描述<span>
 </span><br /><div><br 
/></div>,,TASK_DEV,task,IN_PROGRESS,wait,0,,2022-09-19T01:50:37.000+00:00,,0,,3,720,120,600,zentao:ZentaoAccount:1:1,devlake,zentao:ZentaoAccount:1:5,开发乙,,
+zentao:ZentaoTask:1:3,http://iwater.red:8000/api.php/v1/executions/3/tasks?limit=100&page=1,,3,任务名称,任务描述<span>
 </span><br /><div><br 
/></div>,,TASK_DEV,task,IN_PROGRESS,wait,0,,2022-09-19T01:50:37.000+00:00,,0,zentao:ZentaoStory:1:-1,3,660,0,660,zentao:ZentaoAccount:1:1,devlake,zentao:ZentaoAccount:1:5,开发乙,,
diff --git a/backend/plugins/zentao/tasks/bug_convertor.go 
b/backend/plugins/zentao/tasks/bug_convertor.go
index c55989173..540903154 100644
--- a/backend/plugins/zentao/tasks/bug_convertor.go
+++ b/backend/plugins/zentao/tasks/bug_convertor.go
@@ -78,7 +78,7 @@ func ConvertBug(taskCtx plugin.SubTaskContext) errors.Error {
                                },
                                IssueKey:        
strconv.FormatInt(toolEntity.ID, 10),
                                Title:           toolEntity.Title,
-                               Type:            ticket.BUG,
+                               Type:            toolEntity.StdType,
                                OriginalType:    "bug",
                                OriginalStatus:  toolEntity.Status,
                                ResolutionDate:  
toolEntity.ClosedDate.ToNullableTime(),
diff --git a/backend/plugins/zentao/tasks/bug_extractor.go 
b/backend/plugins/zentao/tasks/bug_extractor.go
index e44cb8cf2..e92892f3c 100644
--- a/backend/plugins/zentao/tasks/bug_extractor.go
+++ b/backend/plugins/zentao/tasks/bug_extractor.go
@@ -137,7 +137,11 @@ func ExtractBug(taskCtx plugin.SubTaskContext) 
errors.Error {
                        }
 
                        if len(statusMappings) != 0 {
-                               bug.StdStatus = statusMappings[bug.Status]
+                               if stdStatus, ok := statusMappings[bug.Status]; 
ok {
+                                       bug.StdStatus = stdStatus
+                               } else {
+                                       bug.StdStatus = bug.Status
+                               }
                        } else {
                                bug.StdStatus = 
ticket.GetStatus(&ticket.StatusRule{
                                        Done:    []string{"resolved"},
diff --git a/backend/plugins/zentao/tasks/story_convertor.go 
b/backend/plugins/zentao/tasks/story_convertor.go
index 8755a51b9..cf66a49a7 100644
--- a/backend/plugins/zentao/tasks/story_convertor.go
+++ b/backend/plugins/zentao/tasks/story_convertor.go
@@ -77,7 +77,7 @@ func ConvertStory(taskCtx plugin.SubTaskContext) errors.Error 
{
                                },
                                IssueKey:                
strconv.FormatInt(toolEntity.ID, 10),
                                Title:                   toolEntity.Title,
-                               Type:                    ticket.REQUIREMENT,
+                               Type:                    toolEntity.StdType,
                                OriginalType:            "story",
                                OriginalStatus:          toolEntity.Status,
                                ResolutionDate:          
toolEntity.ClosedDate.ToNullableTime(),
diff --git a/backend/plugins/zentao/tasks/story_extractor.go 
b/backend/plugins/zentao/tasks/story_extractor.go
index 2989ddf99..787f09b87 100644
--- a/backend/plugins/zentao/tasks/story_extractor.go
+++ b/backend/plugins/zentao/tasks/story_extractor.go
@@ -138,7 +138,11 @@ func ExtractStory(taskCtx plugin.SubTaskContext) 
errors.Error {
                                story.Status = "active"
                        }
                        if len(statusMappings) != 0 {
-                               story.StdStatus = statusMappings[story.Status]
+                               if stdStatus, ok := 
statusMappings[story.Status]; ok {
+                                       story.StdStatus = stdStatus
+                               } else {
+                                       story.StdStatus = story.Status
+                               }
                        } else {
                                story.StdStatus = 
ticket.GetStatus(&ticket.StatusRule{
                                        Done:    []string{"closed"},
diff --git a/backend/plugins/zentao/tasks/task_convertor.go 
b/backend/plugins/zentao/tasks/task_convertor.go
index aa677abfc..d671abdba 100644
--- a/backend/plugins/zentao/tasks/task_convertor.go
+++ b/backend/plugins/zentao/tasks/task_convertor.go
@@ -76,7 +76,7 @@ func ConvertTask(taskCtx plugin.SubTaskContext) errors.Error {
                                IssueKey:                
strconv.FormatInt(toolEntity.ID, 10),
                                Title:                   toolEntity.Name,
                                Description:             toolEntity.Description,
-                               Type:                    ticket.TASK,
+                               Type:                    toolEntity.StdType,
                                OriginalType:            "task",
                                OriginalStatus:          toolEntity.Status,
                                ResolutionDate:          
toolEntity.ClosedDate.ToNullableTime(),
diff --git a/backend/plugins/zentao/tasks/task_extractor.go 
b/backend/plugins/zentao/tasks/task_extractor.go
index 43f0b044e..0e3da7dd3 100644
--- a/backend/plugins/zentao/tasks/task_extractor.go
+++ b/backend/plugins/zentao/tasks/task_extractor.go
@@ -159,7 +159,11 @@ func (c *taskExtractor) toZentaoTasks(accountCache 
*AccountCache, res *models.Ze
                task.StdType = ticket.TASK
        }
        if len(c.statusMappings) != 0 {
-               task.StdStatus = c.statusMappings[task.Status]
+               if stdStatus, ok := c.statusMappings[task.Status]; ok {
+                       task.StdStatus = stdStatus
+               } else {
+                       task.StdStatus = task.Status
+               }
        } else {
                task.StdStatus = ticket.GetStatus(&ticket.StatusRule{
                        Done:    []string{"done", "closed", "cancel"},

Reply via email to