Versions Compared

Key

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


Info
titleAvailability
  • This routine is available starting with katl-commons 4.0.7.
  • This routine is available for Jira server and cloud deployment options.
Table plus
applyColStyleToCelltrue
heading0
columnTypess,s,s,s
multiplefalse
columnAttributesstyle="background:#e5e7ea;font-weight:bold,,style="background:#e5e7ea;font-weight:bold,
enableSortingfalse

Syntax

deleteComment(commentId_or_mode[,

...

tip

issue])

Package

titleNew Parameter

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

Alias

deleteComment(commentId, dispatchEvent)

...

or

,deleteComment(mode,

...

issue, dispatchEvent)

Pkg Usage

Description

Excerpt
hiddentrue
Deletes a comment with the specified id, deletes the latest comment or deletes all comments from a given issue.

Deletes a comment with the specified id, deletes the latest comment or deletes all comments from a given issue.

Parameters

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

Parameter name

Type

Required

Description

commentId_or_mode

Number or String

Yes

Either the comment id (if we use the routine with only one parameter) or one of the next, otherwise:

...

- "DELETE_LATEST" to delete the latest comment for the given issue

...

- "DELETE_ALL" to delete all the comments for the given issue

issue key

String

No

...

IssueKey. Should be used only if the mode is "DELETE_LATEST" or "DELETE_ALL"

...

...

On the server version, the issue key parameter is optional, while on the cloud version it is mandatory and the order of the parameters should be as follows:

(issueKey, commentId_or_mode)

dispatchEvent

Boolean

No

If set to false, the issue comment deleted event will not be triggered. Default value is true.

Note

This parameter is available just on the server version.

...

Return Type

Number

The number of comments deleted.Example

Examples

Example 1

Code Block
return deleteComment("DELETE_ALL", "TEST-1");

Deletes all comments from "TEST-1" and returns the number of comments deleted.

...

Code Block
return deleteComment("DELETE_ALL", "TEST-1", false);

Deletes all comments from "TEST-1" and returns the number of comments deleted. The issue comment deleted event will not be triggered.

...

Deletes the comment with id 12400 and returns "1" because only one comment was deleted.   If If the comment cannot be deleted it will return "0".

...

Deletes the comment with id 12400 and returns "1" because only one comment was deleted.   If If the comment cannot be deleted it will return "0".  The The issue comment deleted event will not be triggered.

...

Filter by label (Content by label)
showLabelsfalse
max25
showSpacefalse
cqllabel = "jira_comment_routine" and space = currentSpace ( )
labelsjiraarray_comment_routineroutines