updateComment method

Future<Comment> updateComment({
  1. required String issueIdOrKey,
  2. required String id,
  3. bool? notifyUsers,
  4. bool? overrideEditableFlag,
  5. String? expand,
  6. required Comment body,
})

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.

Implementation

Future<Comment> updateComment(
    {required String issueIdOrKey,
    required String id,
    bool? notifyUsers,
    bool? overrideEditableFlag,
    String? expand,
    required Comment body}) async {
  return Comment.fromJson(await _client.send(
    'put',
    'rest/api/3/issue/{issueIdOrKey}/comment/{id}',
    pathParameters: {
      'issueIdOrKey': issueIdOrKey,
      'id': id,
    },
    queryParameters: {
      if (notifyUsers != null) 'notifyUsers': '$notifyUsers',
      if (overrideEditableFlag != null)
        'overrideEditableFlag': '$overrideEditableFlag',
      if (expand != null) 'expand': expand,
    },
    body: body.toJson(),
  ));
}