Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info
titleAvailability
  • This routine is available starting with katl-commons 3.0.10.
  • This routine is available for Jira server and cloud deployment options.

Syntax

editComment(commentId, comment)

or

editComment(commentId, comment, securityLevel)

Tip
titleNew Parameter

Starting with sil engine 4.8.0.3, "dispatchEvent" parameter was added. It allows to trigger or not the issue commented event. (Just for server)

editComment(commentId, comment, dispatchEvent)

...

Table plus
applyColStyleToCelltrue
heading0
columnTypess,s,s,s
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

editComment(commentId, comment[, securityLevel, dispatchEvent])

Package

Alias

Pkg Usage

Description

Excerpt
hiddentrue
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

...

The key of the issue.

Note

On the server version, the issue key parameter doesn't exist, while on the cloud version it is mandatory, and the order of the parameters should be as follows:
Cloud: (issueKey, comment_id, comment[, securityLevel])

...

commentId

...

Table plus
applyColStyleToCelltrue
columnTypess,s,s,s
heading0
multiplefalse
enableSortingfalse

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.

...

...

This parameter is available just on the server version.

...

Return Type

JComment

The comment representation with the following keys:

...

Key name

...

Description

...

id

...

Id of the issue comment.

...

Example

...

Examples

Example 1

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

Edits the comment with id 11801 with the specified text.

...

Code Block
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.

...

Code Block
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".

...

Filter by label (Content by label)
showLabelsfalse
max25
showSpacefalse
cqllabel = "comment_routine" and space = currentSpace ( )
labelscommentarray_routineroutines