Our new Appfire Documentation Space is now live!

Take a look here! If you have any questions please email support@appfire.com

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 an important change, such as the following, is made to an issue:

  • comment added

  • issue transitioned

  • issue fields modified

  • issue edited

  • and more

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

Add an event-based action

To create an event-based action:

  1. Navigate to Jira Settings → Manage apps → Event-based actions. This page lists the existing event-based actions with the respective Status, Action name, and Event(s) details.

     

  2. Click Add event-based action to navigate to the Event-based action editor screen where you can add the configuration details.

    Add the following:

    • 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. Click here to see the list of available events.

      • From Status(es) (displayed only when the Issue Transitioned event is selected): 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) (displayed only when the Issue Transitioned event is selected): 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 (displayed only when Issue Field Value Changed is selected): Select one or more fields to run the action 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 using Groovy script.

    • Post-functions: Click Add post-function to navigate to the window that lists all the available post-functions. Select a post-function, configure it as needed and add it to the list here. The post-functions added here 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.

    • 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.

  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 and they are not listed while 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 ones are not supported.

List of events

Synthetic events are specific to JMWE and are meant to capture changes irrespective of how they were made. These events offer more flexibility over the built-in Jira System events.

For example:

  • You can pick the Issue Transitioned Synthetic event over System event(s) like Issue Resolved (or Issue Closed or Issue Reopened), as it allows you to fire an event on transitions beyond those supported by system events.

  • System events like Issue Assigned (and others) come with certain limitations (listed in the table below) where the respective event is not fired as expected always. In such scenario(s), you can use the Issue Field Value Changed Synthetic event instead, to monitor the Assignee field (and/or others) and not miss any change made to the field.

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 modified.

Issue fields can modified using:

  • Issue view screen

  • Edit issue screen

  • Issue transition screen

  • Post-functions

  • Groovy console or REST API calls

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 Reopened

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

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

Edit an event-based action

  1. On the Event-based actions page, click the menu icon 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 the menu icon 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 the Status is 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 the menu icon 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 toggle Off or On to disable or enable the respective event-based action. By default, a newly created event-based action is enabled.