You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hi,
is it possible to create an internal comment for an issue with the java rest client? When i create it with just the comment text itself, the comment is public and visible for customers in the service desk. In the JIRA Gui there is the button "Comment internally" for that.
This is how i currently create an comment:
jiraRestClient.getIssueClient().addComment( issue.getCommentsUri(), Comment.valueOf( "My comment" ) ).claim();
Thanks in advance!
import com.atlassian.jira.rest.client.api.IssueRestClient;
import com.atlassian.jira.rest.client.api.JiraRestClient;
import com.atlassian.jira.rest.client.api.SearchRestClient;
import com.atlassian.jira.rest.client.api.domain.Comment;
import com.atlassian.jira.rest.client.api.domain.SearchResult;
import com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory;
import java.net.URI;
import java.net.URISyntaxException;
class Scratch {
public static void main(String[] args) throws URISyntaxException {
try(JiraRestClient jiraRestClient = new AsynchronousJiraRestClientFactory()
.createWithBasicHttpAuthentication(new URI("https://jira.example.com"), "username", "password")) {
SearchRestClient searchClient = jiraRestClient.getSearchClient();
IssueRestClient issueClient = jiraRestClient.getIssueClient();
String jql = "project = DATA ...";
SearchResult searchResult = searchClient.searchJql(jql).claim();
searchResult.getIssues().forEach(issue -> issueClient.addComment(issue.getCommentsUri(), Comment.valueOf("My comment")));
}
catch (Exception e){
System.out.println("Exception handling...");
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This does not help me because i'm using the java rest client and also jira on premise instead of jira cloud.
In the java rest client i have not the possibility to set properties for an comment...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try to use PUT /rest/api/2/comment/{commentId}/properties/{propertyKey}
I am not sure which java rest client you use. But you can always use the jersey client.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using this library: https://marketplace.atlassian.com/apps/39474/rest-java-client-for-jira?hosting=server&tab=overview
The requests are builded by the library, so i cant modify them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think if a framework does not let you do something, then you either have to ask the developers of the framework, how to do it, or find another framework.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.