I have jira server version 8.17.0 How can I filter the internal comments of the ticket using the API? I found a solution for API v3. But as far as I understand api v3 is only available for Jira Cloud.
You would have to call the Comment Property api looking for the property key "sd.public.comment" for each comment and filter them in your client application.
Welcome to the community.
What do you mean by internal comments? Are they the internal comments made by JSM agents or any restricted comments in JSW?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I want to filter out comments that look like this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, those are the JSM agents' internal comments.
To filter those comments, you can use JSM API's service.
ServiceDeskCommentService commentService = ComponentAccessor.getOSGiComponentInstanceOfType(ServiceDeskCommentService.class);
CommentManager commentManager = ComponentAccessor.getCommentManager();
List<Comment> comments = commentManager.getComments(issue);
iterate the comments and fetch JSM comment by using the service
commentService.getServiceDeskCommentByJiraComment
and use !comment.isPublic() to get internal comments.
I hope I was clear
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Tuncay Senturk _Snapbytes_ I think he's asking about REST API.
And by definition, the service desk rest API will not include any internal comments.
While the jira internal api will include ALL comments. Hence my suggestion to look directly into the comment property.
I guess the other option is to get ALL core comments from an issue and subtract from the list all JSM comments from the corresponding request.
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.