Syntax
addJSDComment(issue, username, comment, isPublic, dispachEvent)
Description
Posts a comment on the specified issue on behalf of the specified user. Returns a number representing the id of the comment.Parameters
Parameter name | Type | Required | Description |
---|---|---|---|
issue key | String | Yes | the key of the selected issue |
user name | String | Yes | the user name of the selected user |
comment | String | Yes | the comment that will be post on the selected issue |
isPublic | Boolean | No | “true” for public comment or “false” for internal comment, default is "true" |
dispachEvent (deprecated) | Boolean | No | “true” if you want to dispach the commentAdded event or “false” if not, default is "true". In newer versions of Service Desk, the API responsible for this feature was deprecated, and Atlassian doesn't use this parameter in newer versions. Please don't use this property for this method. |
Return type
number
The returned number represents the id of the comment. We decided to return this for future use or for third-party custom SIL routines.
Example
Example 1
addJSDComment(key, currentUser(), "I have executed a transition.");
Adds a public comment on the current issue, on behalf of the current user. The commentAdded event will be dispached.
Same as:
addJSDComment(key, currentUser(), "I have executed a transition.", true);
Example 2
addJSDComment(key, currentUser(), "you can't see me", false);
Adds a comment on the current issue, on behalf of the current user, viewable only by internal users. The commentAdded event will be dispached.
Same as:
addJSDComment(key, currentUser(), "you can't see me", false, true);
Example 3
addJSDComment(key, currentUser(), "you can't see me", false, false);
Adds a comment on the current issue, on behalf of the current user, viewable only by internal users. The commentAdded event will not be dispached.
See also
-
getCustomersObjects (Power Scripts for Jira Cloud)
-
getUserOrganizations (Power Scripts for Jira Cloud)
-
getRequestTypePropertyValues (Power Scripts for Jira Cloud)
-
removeCustomersFromServiceDesk (Power Scripts for Jira Cloud)
-
getCustomersFromServiceDesk (Power Scripts for Jira Cloud)
-
deleteRequestTypeProperty (Power Scripts for Jira Cloud)
-
getServiceDeskKBArticles (Power Scripts for Jira Cloud)
-
getRequestsTypes (Power Scripts for Jira Cloud)
-
removeRequestTypeByIdFromServiceDesk (Power Scripts for Jira Cloud)
-
createRequestTypeInServiceDesk (Power Scripts for Jira Cloud)
-
setRequestTypePropertyValue (Power Scripts for Jira Cloud)
-
getRequestTypePropertyKeys (Power Scripts for Jira Cloud)
-
removeFeedbackFromRequest (Power Scripts for Jira Cloud)
-
addFeedbackForRequest (Power Scripts for Jira Cloud)
-
getKBArticles (Power Scripts for Jira Cloud)