【问题标题】:JIRA, get a parent issue via SOAP apiJIRA,通过 SOAP api 获取父问题
【发布时间】:2012-08-08 15:42:23
【问题描述】:

我需要通过 SOAP API 甚至使用数据库来获取给定问题的父问题。这似乎是非常基本的目标,但是我在互联网上没有找到任何有用的信息。此外,我在jira的db表(jiraissue)中没有找到任何字段来设置问题的父问题。

附加信息:Jira 5.1、c# .Net

【问题讨论】:

    标签: api soap jira


    【解决方案1】:

    据我所知,没有办法直接使用 SOAP 来做到这一点。

    一种可能的解决方案是使用the Jira Scripting Suite。您可以创建一个将在Open 状态之后运行的后功能,该功能将使用getParentObject 将父级复制到自定义字段。然后你可以使用 SOAP 函数getCustomFields 来获取父对象。

    另一种通过 REST API 的解决方案:

    Issue issue = getRestClient().getIssueClient().getIssue(task.getKey(), new NullProgressMonitor());
    Field issueParent = issue.getField("parent");
    if (issueParent  !=null){
        JSONObject jsonParent = (JSONObject)issueParent.getValue();
        BasicIssue partsedIssue = null;
        try {
            partsedIssue = new BasicIssueJsonParser().parse(jsonParent);
        } catch (JSONException e1) {
            e1.printStackTrace();
        }
        System.out.println("parent key: "+partsedIssue.getKey());
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-21
      相关资源
      最近更新 更多