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.
Hi soft_licenses@boxberry.ru
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?
I want to filter out comments that look like this
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.
OK, those are the JSM agents' internal comments.
To filter those comments, you can use JSM API's service.
https://docs.atlassian.com/jira-servicedesk/3.7.1/index.html?com/atlassian/servicedesk/api/comment/ServiceDeskCommentService.html
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
@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.
It looks like you're new here. Sign in or register to get started.