
Automate Everyday Tasks in Jira
By :

The starting point for every rule is a trigger. A trigger defines how the rule will activate and will generally listen for events in Jira, such as when an issue is created or when values in fields within an issue change.
In this section, we will begin by looking at Jira events as this will help you to understand when and why rules are triggered, after which we'll explore the available rule triggers, what each of them are, and how they can be used.
To better understand how triggers work, it is worth taking a brief look at how events in Jira work as these are the driving force behind most of the triggers available in the automation rules.
Jira, like many applications, incorporates an event-driven architecture. In essence, this means that every time an action is performed within Jira, an event is fired that allows interested components to listen to and perform additional actions based on those events.
There are two main types of events that affect issues in Jira. The first of these are workflow events. These events are fired when an issue is created and any time an issue is transitioned to a new status in its underlying workflow, and are responsible for causing the Issue created and Issue transitioned triggers in an automation rule to fire.
The second type of event is issue events and these are responsible for the majority of the remainder of the issue triggers and are fired whenever a user (or app) makes a non-workflow-related change to an issue, such as updating a field or linking two issues together.
Jira automation provides us with a number of triggers that we can use to kick off the execution of our rules.
These triggers are grouped into categories to make it easier to identify which type of trigger you will need when creating your rule, and these categories are as follows:
We will take a look at each category in turn and the available triggers in each.
As we mentioned in the Understanding Jira events section, the majority of triggers relate to events occurring on issues, such as when an issue is created or edited.
Most of the triggers are self-explanatory and single purpose. However, there are some that can be further configured to make the trigger more specific without needing to use additional conditions.
Let's take a look at the issue triggers available at the time of writing and what each one does:
There are a few specialized issue triggers worth taking note of and these are the following:
DevOps triggers are specific to Jira Cloud and allow you to create rules that are linked to events in your connected development tools, such as Bitbucket and GitHub.
Let's take a quick look at these triggers and what they do:
Important note
DevOps triggers are not available in Jira Server, although these triggers can be emulated using the Incoming webhook integration trigger.
We will explore these triggers in more detail in Chapter 8, Integrating with DevOps tools.
Scheduled triggers allow you to configure rules that run at defined intervals. These can be simple fixed-rate intervals or more complex schedules.
Scheduled triggers are perfect for automating clean-up processes or to create recurring tasks that need to be actioned and we'll look at these in more detail in Chapter 2, Automating Jira Issues.
The final type of trigger is the incoming webhook. This trigger provides a way for third-party applications to trigger automation rules.
An incoming webhook trigger can specify the exact issues to act on or even provide real-time data that you can use to update issues.
Chapter 5, Working with External Systems, is dedicated to exploring the ways in which we can integrate our automation rules with external systems.
Change the font size
Change margin width
Change background colour