How to get id of comment after create via jrjc?

Hi,

I use the jrjc (jira rest java client) to add new comment in the client server.
Something like this.

public void addComment(String issueKey, String comment) {
    IssueRestClient issueClient = restClient.getIssueClient();
    try {
      Issue issue = issueClient.getIssue(issueKey).claim();
      URI issueURI = new URI(issue.getSelf().toString() + "/comment/");
      Comment jiraComment = Comment.valueOf(comment);
      issueClient.addComment(issueURI, jiraComment).claim();
    } catch (URISyntaxException e) {
      log.error("URI exception: ", e);
    }
  }

But right now I want to get the id of comment after add. How can I do it?

Many thanks,

2 Likes