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 -
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 TypeMethodDescriptionjavax.ws.rs.core.Response
addComment
(String issueIdOrKey, String expand, CommentJsonBean request) Adds a new comment to an issue.javax.ws.rs.core.Response
deleteComment
(String issueIdOrKey, String commentId) Deletes an existing comment .javax.ws.rs.core.Response
getComment
(String issueIdOrKey, String commentId, String expand) Returns a single issue comment.javax.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.javax.ws.rs.core.Response
getPinnedComments
(String issueIdOrKey) Returns list of pinned to issue comments.javax.ws.rs.core.Response
setPinComment
(String issueIdOrKey, String commentId, boolean pinned) javax.ws.rs.core.Response
updateComment
(String issueIdOrKey, String commentId, String expand, CommentJsonBean request) Updates an existing comment using its JSON representation.
-
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 javax.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:
commentId
- the ID of the comment to requestissueIdOrKey
- of the issue the comment belongs toexpand
- optional flags: renderedBody (provides body rendered in HTML), properties (provides comment properties).- Returns:
- a Response containing a CommentJsonBean
-
updateComment
public javax.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 javax.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
-