美文网首页Java
Java Jira API get comments of a

Java Jira API get comments of a

作者: JaedenKil | 来源:发表于2021-10-12 15:14 被阅读0次

    Need to import com.konghq:unirest-java:3.13.0.

    HttpResponse<JsonNode> response = Unirest.get(String.format("https://your-domain.atlassian.net/rest/api/3/issue/%s/comment", ticket))
        .basicAuth("email@example.com", "<api_token>")
        .header("Accept", "application/json")
        .asJson();
    JSONObject res = response.getBody().getObject();
    JSONObject firstComment = (JSONObject) res.getJSONArray("comments").get(0);
    String comment = firstComment.getString("body");
    System.out.println(comment);
    

    相关文章

      网友评论

        本文标题:Java Jira API get comments of a

        本文链接:https://www.haomeiwen.com/subject/mundoltx.html