Add a Jira Comment Action

This page is about Easy Integrations for Jira Cloud. Using Jira On-Prem? Click the On-Prem button above.

The Add a Jira Comment action can be used to comment on any Jira issue. This documentation provides step-by-step instructions on how to configure this action within Easy Integration.

How to Configure the Add a Jira Comment Action

The Add a Jira Comment action in Listeners can be accessed within Easy Integration's admin UI. Follow these steps to configure:

  1. Navigate to Jira's top menu, and click Apps.

  2. Select Manage your apps.

  3. In the sidebar, locate and click Easy Integrations configuration.

  4. Select Listeners from the app’s top menu.

  5. Configure the listener according to your requirements. For more information on that, refer to this documentation.

  6. In the Actions section of the listener configuration, click Add a Jira Comment.

Here's how to set up the Add a Jira Comment action:

  1. Action name – Give a descriptive name to easily identify this action.

  2. Condition – Enable or disable the condition.
    When enabled, provide a JavaScript condition for the listener. The action will execute only if the script returns true. You can refer to Context variables, Scripts, and Events for more details. For example:
    return startsWith(data.event.issue.fields.summary, 'Sultans of Swing');

  3. Custom issue key – When unchecked, the event’s issue will be used. When checked, a custom issue will be used.

  4. Issue ID or Key script – Write a JavaScript script that returns an Issue ID or key. You can use event data or previous action data in the script. For example:
    return data.apiData.api1.responseBody.issueId;

  5. Visibility – For Service Management projects, select either "Internal Only" or "Share with Customer". For Software and Business projects, select either a role or a group.

  6. Comment Text script – Write a JavaScript script that returns a text for comment. Event data or previous action data can be used in the script. For example:
    return data.event.issue.fields.summary;

  7. Click Save, and then save your listener configuration as well.

That’s it! You have successfully configured the Send an Email for a Jira Issue action in Easy Integrations. To gain more insights, check out the following example:

Example 1: Add a Jira Comment

The following example adds a comment to an issue, in which the issue key is fetched from the second action response, and the comment text is fetched from the first action.

Note: This is a sample use case and can be customized to suit your integration needs.