Event-based actions

JMWE’s Event-based actions enable administrators to run one or more post-functions independent of Jira Workflow transitions. You can create actions that run a sequence of post-functions every time a change is made to an issue. Changes to monitor include, but are not limited to, events such as:

  • Comment added

  • Issue transitioned

  • Issue fields modified

  • Issue edited

  • And more

You can use Event-based actions to:

  • Synchronize changes to a field with related issues such as sub-tasks, linked issues, epics, etc.

  • Calculate the value of a field based on the values of other fields

  • Copy a comment added by a customer on a Service Management request to linked Jira Software issues

  • Validate data when a user edits an issue field on the issue view screen

  • And much more

To open the Event-based actions page:

  1. Log in to your JIRA Server instance as an administrator.

  2. Click on the Administration icon in the upper right corner.

  3. Select Manage Apps.

  4. Locate JIRA MISC WORKFLOW EXTENSIONS in the left panel and select Event-based actions.

Add an event-based action

To create an event-based action:

  1. From the Event-based actions page (Figure 1, right), click Add event-based action in the upper-right corner.

  2. The Event-based action editor screen (Figure 2, right) will open, where you can add configuration details:

    • Action name - Enter a meaningful name for the action.

    • Description - Enter a more detailed explanation of what the action would accomplish.

    • Event - Select the Jira event that triggers the action. Refer to List of Events, below, for the full list of available events and their details.

      • From Status(es) - Only visible when Event is set to ‘Issue Transitioned’. Select one or more statuses from the available options to trigger the event whenever the issue is transitioned from the mentioned status(es).
        When this is left empty, transitioning from any of the listed statuses is considered as a trigger.

      • To Status(es) - Only visible when Event is set to ‘Issue Transitioned’. Select one or more statuses from the available options to trigger the event whenever the issue is transitioned to the mentioned status(es).
        When this is left empty, transitioning to any of the listed statuses is considered as a trigger.

      • Fields to monitor - Only visible when Event is set to ‘Issue Field Value Changed’. Select one or more fields to monitor. The action will run whenever a change occurs in the specified field(s).

      • Ignore events caused by JMWE post-functions and actions - Select this option to ignore the events resulting from changes made by JMWE’s post-functions and actions that trigger this event-based action, by default. If you do not select this option, it increases the risk of creating an infinite loop if this event-based action makes changes that end up triggering the same event that the action listens to.

    • Scope - Specify the project(s) and issue type(s) on which the action is run. You can also filter specific issues using a JQL expression or condition based on a Groovy script.

      • Projects - Select one or more projects from the available options for the action to be applied on. When you leave this field empty, the action is applied to all the projects in your Jira instance.

      • Issue types - Select one or more issue types from the available options for the action to be applied on. When you leave this field empty, the action is applied to all the issue types in your Jira instance.

      • Only apply to issues that match a JQL filter - Select this option to enter a JQL expression in the area provided. The action is run only on the issues matching the specified JQL expression.

      • Only if condition is true - Select this option to enter a Condition using Groovy script. This action is run on the specified issue(s) only when the mentioned Groovy script returns true for the issue(s). For more information, refer to Conditional execution/validation using a Groovy expression.

      • Error handling
        Skip subsequent post-functions if a post-function encounters an error: Select this option to skip running the remaining post functions in the sequence when an error occurs in one of the post functions.

    • Post-functions - Click Add post-function to add a post-function to the action. Select a post-function, configure it as needed and add it to the list. The post-functions added are run in the sequence displayed. You can use the ☰ handle to drag a post-function and drop it wherever required in the list to reorder the sequence.

  3. Click Save to add the newly created event-based action to the Event-based action screen.

Some post-functions are not supported by event-based actions; they will not be listed when adding one to the Post-functions section. Click the link provided in the bottom left corner of the Add Post Function window to see which are not supported.

Edit an event-based action

  1. On the Event-based actions page, click Action ( ) next the event-based action you wish to modify and select Edit .

  2. Modify the action details in the Event-based action editor screen.

  3. Click Save to save the changes.

Copy an event-based action

Sometimes it is easier to create a new action based on one that already exists. The Copy option lets you do just that.

  1. On the Event-based actions page, click Action ( ) next the action you wish to duplicate and select Copy.

  2. A new event-based action is created with “Copy of” in front of the action name and a Status of disabled by default.

  3. Follow the steps in Edit an event-based action above, to make modifications.

Delete an event-based action

  1. On the Event-based actions page, click Action ( ) next the action you wish to delete and select Delete to remove the respective action permanently.

  2. Click OK in the confirmation dialog to confirm. The event-based action is deleted.

Enable or disable an event-based action

In the Event-based action screen, turn the Enabled toggle Off or On to disable or enable the respective event-based action. By default, a newly created event-based action is enabled.

Note: if you hover on the Enable/Disable toggle, a tooltip will appear with information on the last user who enabled or disabled the action, and when! This tooltip does not appear for newly-created actions, and may require a page refresh after an action’s setting has been changed.

You are viewing the documentation for Jira Server / Data Center.

On this page

Figure 1 - Event-based actions Page

 

Figure 2 - Event-based action editor

 

List of events

Event type

Event

Description

Limitations

Event type

Event

Description

Limitations

Synthetic

(JMWE specific events)

Issue Transitioned

Triggered when an issue is transitioned from the mentioned From Status(es) to the To Status(es).

N/A

Issue Field Value Changed

Triggered whenever the specified issue field(s) mentioned in Fields to monitor are updated.

Issue fields can be modified using:

  • Issue view screen

  • Edit issue screen

  • Issue transition screen

  • Post-functions

  • Groovy console or REST API calls

Issue Watcher Added

Triggered when a user starts watching an issue.

N/A

Issue Watcher Deleted

Triggered when a user stops watching an issue.

N/A

Issue Link Created

Triggered when a link is added to an issue.

N/A

Issue Link Deleted

Triggered when a link is removed from an issue.

N/A

System

(Built-in Jira events)

Issue Created

Triggered whenever an issue is created:

  • Manually using the Create button on the top navigation bar or cloning

  • Using post-function

  • Using REST API call

N/A

Issue Updated

Triggered whenever any issue field value is changed using the:

  • Issue view screen

  • Edit issue option

  • Groovy console

The following changes made to an issue do not trigger the Issue Updated event:

  • Changing the assignee using the Assign to me link below the Assignee field

  • Adding or removing issue links, watchers, or voters

  • Adding or changing issue fields on a transition screen

  • Changing a field value using JMWE post function on the current issue when post function is positioned before the Update change history post-function

Issue Assigned

Triggered whenever an issue is assigned to a new user using the:

  • Assign action button on the top

  • Assign to me link to the right of the screen

The following changes to the Assignee field do not trigger the Issue Assigned event:

  • Manually by entering a name or selecting from the drop-down

  • On issue edit screen

  • During transition

  • Using JMWE post-function

  • Using Groovy script

Issue Resolved

Triggered when Jira fires the Issue Resolved event configured by the Jira administrator in the workflow post-function.

N/A

Issue Closed

Triggered when Jira fires the Issue Closed event configured by the Jira administrator in the workflow post-function.

N/A

Issue Commented

Triggered whenever a comment is added to an issue:

  • Using the Issue view screen

  • As a result of Comment issue post-function, where the Send “Issue commented“ notification option is enabled while configuring the post-function

The following changes to an issue do not trigger the Issue Commented event:

Adding a comment:

  • While transitioning an issue

  • On the edit issue screen

  • Using the Comment issue post-function where Send “Issue commented“ notification option is disabled

Issue Comment Edited

Triggered whenever a comment on an issue is edited.

N/A

Issue Comment Deleted

Triggered whenever a comment on an issue is deleted.

N/A

Issue Reopened

Triggered when Jira fires the Issue Reopened event configured by the Jira administrator in the workflow post-function.

N/A

Issue Deleted

Triggered whenever an issue is deleted.

N/A

Issue Moved

Triggered whenever an issue is moved.

N/A

Work Logged On Issue

Triggered whenever the worklog (typically in hours) is added to the issue:

  • In the Issue view

  • Using the Groovy console or REST API

N/A

Work Started On Issue

Triggered when a Jira administrator configures a Jira workflow to fire an event whenever an assignee starts working on an issue

 

N/A

Work Stopped On Issue

Triggered when a Jira administrator configures a Jira workflow to fire an event whenever an assignee stops working on an issue

 

N/A

Issue Worklog Updated

Triggered when a Jira administrator configures a Jira workflow to fire an event whenever the worklog of an issue is modified:

  • In the issue view

  • Using the Groovy console or REST API

N/A

Issue Worklog Deleted

Triggered when a Jira administrator configures a Jira workflow to fire an event whenever the worklog of an issue is deleted:

  • Manually

  • Using the Groovy console or REST API

N/A

Generic Event

Triggered whenever a generic event is invoked by a worklog post-function. A generic event can be configured to invoke a listener (or can be customized).

This event is triggered by default while running a post function during a transition. In a scenario where the administrator does not configure a Generic event by default, this event is not triggered.

N/A

Custom

(Customized events that invoke a listener)

Events (both active and inactive) configured on your Jira instance are displayed here

Triggered whenever the respective custom event is fired by Jira.

Click here to learn about adding custom events.

N/A