From 5287294ae3a44579bc91e2d4b2e8dfce8ac24a40 Mon Sep 17 00:00:00 2001 From: zhaoqian Date: Tue, 12 Apr 2022 17:57:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20tf?= =?UTF-8?q?s=E5=B9=B3=E5=8F=B0=E7=BC=BA=E9=99=B7=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=20=E5=90=8C=E6=AD=A5=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1012110 --user=zhaoqian 用户在tfs平台自定义缺陷模板,添加自定义字段,无法同步到ms的问题处理 --- .../AzureDevopsWorkItemsBatchResponse.java | 31 +++++-------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/backend/src/main/java/io/metersphere/track/issue/domain/azure/AzureDevopsWorkItemsBatchResponse.java b/backend/src/main/java/io/metersphere/track/issue/domain/azure/AzureDevopsWorkItemsBatchResponse.java index 15e011f564..9933d12c29 100644 --- a/backend/src/main/java/io/metersphere/track/issue/domain/azure/AzureDevopsWorkItemsBatchResponse.java +++ b/backend/src/main/java/io/metersphere/track/issue/domain/azure/AzureDevopsWorkItemsBatchResponse.java @@ -1,5 +1,6 @@ package io.metersphere.track.issue.domain.azure; +import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.annotation.JSONField; import lombok.Getter; import lombok.Setter; @@ -19,32 +20,14 @@ public class AzureDevopsWorkItemsBatchResponse { public class Value { private int id; private int rev; - private Fields fields; + private JSONObject fields; private String url; - @Getter - @Setter - public class Fields { - @JSONField(name = "System.Id") - private int systemId; - @JSONField(name = "System.WorkItemType") - private String systemWorkItemType; - @JSONField(name = "System.Title") - private String systemTitle; - @JSONField(name = "System.State") - private String state; - @JSONField(name = "System.Description") - private String description; - @JSONField(name = "System.AssignedTo") - private String assignedTo; - @JSONField(name = "System.ChangedBy") - private String changedBy; - @JSONField(name = "System.CreatedBy") - private String createdBy; - @JSONField(name = "Microsoft.VSTS.TCM.ReproSteps") - private String reproSteps; - @JSONField(name = "System.CreatedDate") - private String createdDate; + public String getFieldsValue(String name) { + if (fields != null && fields.containsKey(name)) { + return fields.getString(name); + } + return ""; } } }