Package com.atlassian.jira.rest.v2.issue
Class CommentResource
java.lang.Object
com.atlassian.jira.rest.v2.issue.CommentResource
- Since:
- 4.2
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCommentResource(CommentService commentService, JiraAuthenticationContext authContext, I18nHelper i18n, ProjectRoleManager projectRoleManager, JiraBaseUrls jiraBaseUrls, IssueFinder issueFinder, DateTimeFormatterFactory dateTimeFormatterFactory, RendererManager rendererManager, FieldLayoutManager fieldLayoutManager, EmailFormatter emailFormatter) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponseaddComment(String issueIdOrKey, String expand, CommentJsonBean request) Adds a new comment to an issue.jakarta.ws.rs.core.ResponsedeleteComment(String issueIdOrKey, String commentId) Deletes an existing comment .jakarta.ws.rs.core.ResponsegetComment(String issueIdOrKey, String commentId, String expand) Returns a single issue comment.jakarta.ws.rs.core.ResponsegetComments(String issueIdOrKey, String expand, PageRequest pageRequest, io.atlassian.fugue.Option<OrderByRequest<CommentResource.CommentField>> orderByRequest) Returns all comments for an issue.jakarta.ws.rs.core.ResponsegetPinnedComments(String issueIdOrKey) Returns list of pinned to issue comments.jakarta.ws.rs.core.ResponsesetPinComment(String issueIdOrKey, String commentId, boolean pinned) jakarta.ws.rs.core.ResponseupdateComment(String issueIdOrKey, String commentId, String expand, CommentJsonBean request) Updates an existing comment using its JSON representation.
-
Field Details
-
ERROR_ISSUE_INVALID
- See Also:
-
ERROR_NO_COMMENT_FOR_ID
- See Also:
-
ERROR_INVALID_ISSUE_FOR_COMMENT
- See Also:
-
-
Constructor Details
-
CommentResource
@Inject public CommentResource(CommentService commentService, JiraAuthenticationContext authContext, I18nHelper i18n, ProjectRoleManager projectRoleManager, JiraBaseUrls jiraBaseUrls, IssueFinder issueFinder, DateTimeFormatterFactory dateTimeFormatterFactory, RendererManager rendererManager, FieldLayoutManager fieldLayoutManager, EmailFormatter emailFormatter)
-
-
Method Details
-
getComments
public jakarta.ws.rs.core.Response getComments(String issueIdOrKey, String expand, PageRequest pageRequest, io.atlassian.fugue.Option<OrderByRequest<CommentResource.CommentField>> orderByRequest) Returns all comments for an issue.- Parameters:
issueIdOrKey- to get comments forexpand- optional flags: renderedBody (provides body rendered in HTML), properties (provides comment properties).- Returns:
- all comments for the issue
-
getComment
Returns a single issue comment.- Parameters:
issueIdOrKey- of the issue the comment belongs tocommentId- the ID of the comment to requestexpand- optional flags: renderedBody (provides body rendered in HTML), properties (provides comment properties).- Returns:
- a Response containing a CommentJsonBean
-
updateComment
public jakarta.ws.rs.core.Response updateComment(String issueIdOrKey, String commentId, String expand, CommentJsonBean request) Updates an existing comment using its JSON representation.- Parameters:
issueIdOrKey- a string containing the issue id or key the comment belongs tocommentId- id of the comment to be updatedexpand- optional flags: renderedBody (provides body rendered in HTML), properties (provides comment properties).request- json body of request converted to aCommentJsonBean- Returns:
- updated Comment
-
deleteComment
Deletes an existing comment .- Parameters:
issueIdOrKey- a string containing the issue id or key the comment belongs tocommentId- id of the comment to be deleted- Returns:
- No Content Response
-
setPinComment
-
getPinnedComments
Returns list of pinned to issue comments.- Parameters:
issueIdOrKey- of the issue the comment belongs to- Returns:
- all pinned to the issue comments
-
addComment
public jakarta.ws.rs.core.Response addComment(String issueIdOrKey, String expand, CommentJsonBean request) Adds a new comment to an issue.- Parameters:
issueIdOrKey- a string containing the issue id or key the comment will be added toexpand- optional flags: renderedBody (provides body rendered in HTML), properties (provides comment properties).request- json body of request converted to aCommentJsonBean- Returns:
- the added comment
-