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/09/01 12:36:21 UTC
[incubator-devlake] branch release-v0.12 updated: fix(jira): change jira issuetype api version #2883 (#2896)
This is an automated email from the ASF dual-hosted git repository.
warren pushed a commit to branch release-v0.12
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/release-v0.12 by this push:
new 2ba3235b fix(jira): change jira issuetype api version #2883 (#2896)
2ba3235b is described below
commit 2ba3235b72e7ba53ea0b6afa7c2ce9138de55682
Author: zhangzhenyu2 <13...@139.com>
AuthorDate: Wed Aug 31 16:52:23 2022 +0800
fix(jira): change jira issuetype api version #2883 (#2896)
* fix(jira): change jira issuetype api version #2883
* fix(jira): change jira issuetype api version #2883
Co-authored-by: zhangzhenyu <zh...@hqins.cn>
---
plugins/jira/tasks/issue_type_collector.go | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/plugins/jira/tasks/issue_type_collector.go b/plugins/jira/tasks/issue_type_collector.go
index e7f69ec1..78058341 100644
--- a/plugins/jira/tasks/issue_type_collector.go
+++ b/plugins/jira/tasks/issue_type_collector.go
@@ -21,6 +21,7 @@ import (
"encoding/json"
"github.com/apache/incubator-devlake/plugins/core"
"github.com/apache/incubator-devlake/plugins/helper"
+ "github.com/apache/incubator-devlake/plugins/jira/models"
"net/http"
)
@@ -40,6 +41,11 @@ func CollectIssueTypes(taskCtx core.SubTaskContext) error {
data := taskCtx.GetData().(*JiraTaskData)
logger := taskCtx.GetLogger()
logger.Info("collect issue_types")
+
+ urlTemplate := "api/3/issuetype"
+ if data.JiraServerInfo.DeploymentType == models.DeploymentServer {
+ urlTemplate = "api/2/issuetype"
+ }
collector, err := helper.NewApiCollector(helper.ApiCollectorArgs{
RawDataSubTaskArgs: helper.RawDataSubTaskArgs{
Ctx: taskCtx,
@@ -51,7 +57,7 @@ func CollectIssueTypes(taskCtx core.SubTaskContext) error {
},
ApiClient: data.ApiClient,
Concurrency: 1,
- UrlTemplate: "api/3/issuetype",
+ UrlTemplate: urlTemplate,
ResponseParser: func(res *http.Response) ([]json.RawMessage, error) {
var data []json.RawMessage