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

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


The following commit(s) were added to refs/heads/main by this push:
     new 56b6f1db fix(jira): change jira issuetype api version #2883 (#2896)
56b6f1db is described below

commit 56b6f1db78931f2f569d93762025607cafb116c4
Author: zhangzhenyu2 <[email protected]>
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 <[email protected]>
---
 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

Reply via email to