---
title: "editComment"
canonical: "https://support.appfire.com/space/PSJ/15484757/editComment"
format: markdown
---
> Macro (aura-html)


|  |  |  |  |
| --- | --- | --- | --- |
| **Syntax** | editComment(commentId, comment[, securityLevel, dispatchEvent]) | **Package** |  |
| **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Edits a comment with the specified id and text.

Edits a comment with the specified id and text. Optional, you can edit the security level for comment. Returns the comment representation after the edit.

## Parameters

| Parameter name | Type | Required | Description |
| --- | --- | --- | --- |
| commentId | Number | Yes | Id of the issue comment. |
| comment | String | Yes | Text that will be post on the selected comment. |
| securityLevel | String | No | Security level of comment. Can be a group or a project role. |
| dispatchEvent | Boolean | No | If set to false, the issue comment edited event will not be triggered. Default value is true. |

## Return Type

**[JComment](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/15487117)**

The comment representation with the following keys:

## Examples

### Example 1

```
string newComm = "This comment was edited.";
return editComment(11801, newComm);
```

Edits the comment with id 11801 with the specified text.

### Example 2

```
string newComm = "This comment was edited.";
return editComment(11801, newComm, false);
```

Edits the comment with id 11801 with the specified text, the issue comment edited event will not be triggered.

### Example 3

```
JComment jcomment = getCommentById(11801);
string oldComm = jcomment["text"];
string newComm = oldComm + "\nEditing the comment";
return editComment (11801, newComm, "Developers");
```

Edits a comment by adding new text to the old one and that can be viewed only by "Developers".

## See also

> Macro (contentbylabel)