All URIs are relative to https://your-domain.atlassian.com
Method | HTTP request | Description |
---|---|---|
addComment | POST /rest/api/3/issue/{issueIdOrKey}/comment | Add comment |
deleteComment | DELETE /rest/api/3/issue/{issueIdOrKey}/comment/{id} | Delete comment |
getComment | GET /rest/api/3/issue/{issueIdOrKey}/comment/{id} | Get comment |
getComments | GET /rest/api/3/issue/{issueIdOrKey}/comment | Get comments |
getCommentsByIds | POST /rest/api/3/comment/list | Get comments by IDs |
updateComment | PUT /rest/api/3/issue/{issueIdOrKey}/comment/{id} | Update comment |
Comment addComment(body, issueIdOrKey, expand)
Add comment
Adds a comment to an issue. This operation can be accessed anonymously. Permissions required: * Browse projects and Add comments project permission for the project that the issue containing the comment is in. * If issue-level security is configured, issue-level security permission to view the issue.
// Import classes:
//import com.xminds.jira.rest.client.ApiClient;
//import com.xminds.jira.rest.client.ApiException;
//import com.xminds.jira.rest.client.Configuration;
//import com.xminds.jira.rest.client.auth.*;
//import com.xminds.jira.rest.client.api.IssueCommentsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
IssueCommentsApi apiInstance = new IssueCommentsApi();
Map<String, Object> body = new Map(); // Map<String, Object> |
String issueIdOrKey = "issueIdOrKey_example"; // String | The ID or key of the issue.
String expand = "expand_example"; // String | Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML.
try {
Comment result = apiInstance.addComment(body, issueIdOrKey, expand);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IssueCommentsApi#addComment");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
body | Map<String, Object> | ||
issueIdOrKey | String | The ID or key of the issue. | |
expand | String | Use expand to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. | [optional] |
- Content-Type: application/json
- Accept: application/json
deleteComment(issueIdOrKey, id)
Delete comment
Deletes a comment. Permissions required: * Browse projects project permission for the project that the issue containing the comment is in. * If issue-level security is configured, issue-level security permission to view the issue. * Delete all comments project permission to delete any comment or Delete own comments to delete comment created by the user, * If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted to.
// Import classes:
//import com.xminds.jira.rest.client.ApiClient;
//import com.xminds.jira.rest.client.ApiException;
//import com.xminds.jira.rest.client.Configuration;
//import com.xminds.jira.rest.client.auth.*;
//import com.xminds.jira.rest.client.api.IssueCommentsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
IssueCommentsApi apiInstance = new IssueCommentsApi();
String issueIdOrKey = "issueIdOrKey_example"; // String | The ID or key of the issue.
String id = "id_example"; // String | The ID of the comment.
try {
apiInstance.deleteComment(issueIdOrKey, id);
} catch (ApiException e) {
System.err.println("Exception when calling IssueCommentsApi#deleteComment");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
issueIdOrKey | String | The ID or key of the issue. | |
id | String | The ID of the comment. |
null (empty response body)
- Content-Type: Not defined
- Accept: Not defined
Comment getComment(issueIdOrKey, id, expand)
Get comment
Returns a comment. This operation can be accessed anonymously. Permissions required: * Browse projects project permission for the project containing the comment. * If issue-level security is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted to.
// Import classes:
//import com.xminds.jira.rest.client.ApiClient;
//import com.xminds.jira.rest.client.ApiException;
//import com.xminds.jira.rest.client.Configuration;
//import com.xminds.jira.rest.client.auth.*;
//import com.xminds.jira.rest.client.api.IssueCommentsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
IssueCommentsApi apiInstance = new IssueCommentsApi();
String issueIdOrKey = "issueIdOrKey_example"; // String | The ID or key of the issue.
String id = "id_example"; // String | The ID of the comment.
String expand = "expand_example"; // String | Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML.
try {
Comment result = apiInstance.getComment(issueIdOrKey, id, expand);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IssueCommentsApi#getComment");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
issueIdOrKey | String | The ID or key of the issue. | |
id | String | The ID of the comment. | |
expand | String | Use expand to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. | [optional] |
- Content-Type: Not defined
- Accept: application/json
PageOfComments getComments(issueIdOrKey, startAt, maxResults, orderBy, expand)
Get comments
Returns all comments for an issue. This operation can be accessed anonymously. Permissions required: Comments are included in the response where the user has: * Browse projects project permission for the project containing the comment. * If issue-level security is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is restricted to.
// Import classes:
//import com.xminds.jira.rest.client.ApiClient;
//import com.xminds.jira.rest.client.ApiException;
//import com.xminds.jira.rest.client.Configuration;
//import com.xminds.jira.rest.client.auth.*;
//import com.xminds.jira.rest.client.api.IssueCommentsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
IssueCommentsApi apiInstance = new IssueCommentsApi();
String issueIdOrKey = "issueIdOrKey_example"; // String | The ID or key of the issue.
Long startAt = 0L; // Long | The index of the first item to return in a page of results (page offset).
Integer maxResults = 50; // Integer | The maximum number of items to return per page.
String orderBy = "orderBy_example"; // String | [Order](#ordering) the results by a field. Accepts *created* to sort comments by their created date.
String expand = "expand_example"; // String | Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML.
try {
PageOfComments result = apiInstance.getComments(issueIdOrKey, startAt, maxResults, orderBy, expand);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IssueCommentsApi#getComments");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
issueIdOrKey | String | The ID or key of the issue. | |
startAt | Long | The index of the first item to return in a page of results (page offset). | [optional] [default to 0] |
maxResults | Integer | The maximum number of items to return per page. | [optional] [default to 50] |
orderBy | String | Order the results by a field. Accepts created to sort comments by their created date. | [optional] [enum: created, -created, +created] |
expand | String | Use expand to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. | [optional] |
- Content-Type: Not defined
- Accept: application/json
PageBeanComment getCommentsByIds(body, expand)
Get comments by IDs
Returns a paginated list of just the comments for a list of comments specified by comment IDs. This operation can be accessed anonymously. Permissions required: Comments are returned where the user: * has Browse projects project permission for the project containing the comment. * If issue-level security is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to.
// Import classes:
//import com.xminds.jira.rest.client.ApiClient;
//import com.xminds.jira.rest.client.ApiException;
//import com.xminds.jira.rest.client.Configuration;
//import com.xminds.jira.rest.client.auth.*;
//import com.xminds.jira.rest.client.api.IssueCommentsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
IssueCommentsApi apiInstance = new IssueCommentsApi();
IssueCommentListRequestBean body = new IssueCommentListRequestBean(); // IssueCommentListRequestBean | The list of comment IDs.
String expand = "expand_example"; // String | Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts a comma-separated list. Expand options include: * `renderedBody` Returns the comment body rendered in HTML. * `properties` Returns the comment's properties.
try {
PageBeanComment result = apiInstance.getCommentsByIds(body, expand);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IssueCommentsApi#getCommentsByIds");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
body | IssueCommentListRequestBean | The list of comment IDs. | |
expand | String | Use expand to include additional information about comments in the response. This parameter accepts a comma-separated list. Expand options include: * `renderedBody` Returns the comment body rendered in HTML. * `properties` Returns the comment's properties. | [optional] |
- Content-Type: application/json
- Accept: application/json
Comment updateComment(body, issueIdOrKey, id, expand)
Update comment
Updates a comment. This operation can be accessed anonymously. Permissions required: * Browse projects project permission for the project that the issue containing the comment is in. * If issue-level security is configured, issue-level security permission to view the issue. * Edit all comments project permission to update any comment or Edit own comments to update comment created by the user. * If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted to.
// Import classes:
//import com.xminds.jira.rest.client.ApiClient;
//import com.xminds.jira.rest.client.ApiException;
//import com.xminds.jira.rest.client.Configuration;
//import com.xminds.jira.rest.client.auth.*;
//import com.xminds.jira.rest.client.api.IssueCommentsApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
// Configure HTTP basic authorization: basicAuth
HttpBasicAuth basicAuth = (HttpBasicAuth) defaultClient.getAuthentication("basicAuth");
basicAuth.setUsername("YOUR USERNAME");
basicAuth.setPassword("YOUR PASSWORD");
IssueCommentsApi apiInstance = new IssueCommentsApi();
Map<String, Object> body = new Map(); // Map<String, Object> |
String issueIdOrKey = "issueIdOrKey_example"; // String | The ID or key of the issue.
String id = "id_example"; // String | The ID of the comment.
String expand = "expand_example"; // String | Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML.
try {
Comment result = apiInstance.updateComment(body, issueIdOrKey, id, expand);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling IssueCommentsApi#updateComment");
e.printStackTrace();
}
Name | Type | Description | Notes |
---|---|---|---|
body | Map<String, Object> | ||
issueIdOrKey | String | The ID or key of the issue. | |
id | String | The ID of the comment. | |
expand | String | Use expand to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. | [optional] |
- Content-Type: application/json
- Accept: application/json