Jira Automation Guide With Examples
Creating Jira automation rules to speed up your processes may seem intimidating at first glance, but the process is much simpler when you try it. Here's how!
Join the DZone community and get the full member experience.
Join For FreeJira has many flaws that have been picked on by countless competitors like monday.com. Yet there’s a reason why Atlassian dominates the project management market with a whopping 86.63% in the bug-and-issue-tracking market: the flexibility and customizability of their solutions.
Jira Automation 101
Jira Automation is a no-code feature that allows Jira users to create if this – then that conditions based on a wide selection of events and triggers like, for example, an issue being moved from “todo” to “in progress” or all subtasks of a parent issue being moved to “done.”
Some of the most common uses of automation for Jira are:
- Making changes based on issue workflow transitions.
- Automatically assigning tasks to specific team members based on the content of an issue.
- Sending periodic status updates.
- Automatically creating issues for recurring tasks.
Project vs. Global Automation Rules
It is important to note that while the automation functionality comes with all Jira plans, the ability to add global or multi-project automation features is reserved for Premium and Enterprise plan users.
Project-specific automation means that if you have a need to set up the same rules across multiple projects – you’ll need to set them up individually, whereas you can set them up once and apply them across multiple projects with global permissions.
Users and Permissions
Not every Jira user can create or edit automation rules. You will need to be a Jira admin or a Project Admin in order to access this functionality.
You can access automation by clicking on the settings button⚙️>System>Global automation.
Automation Rules
Automations in Jira are called rules. You can create automation rules using four components:
1. Trigger: When a user performs a trigger action, the automation rule will run.
2. Condition: This element ensures that the automation is triggered if all of the conditions are met.
3. New branch: This element creates a branch that allows to set up of separate conditions for certain elements, like subtasks of a parent issue.
4. New action: This element defines what the system will do when the user triggers a rule and all of the conditions are met.
Don’t worry if this seems too complicated or overly complex – all Jira best practices look hard at first. Luckily, creating rules is only intimidating on paper and gets much easier with practice. Speaking of the devil – let’s do just that and create a custom automation rule.
Let’s say we want to send out an email to pending approvers when someone leaves a comment with an attachment in the issue.
Let’s start by adding a trigger.
Start by creating a new rule, and you will be prompted to add the trigger. Type in the thing you’d like to add as a trigger into the search bar. In our case, we want the rule to start when someone comments on an issue.
Then you’ll choose a comment type from the dropdown menu options. You can use one or several options here.
Next, you’ll be prompted to add a component. We can add an action to send an email to certain users at this stage. We won’t, though, because that’s not what we want, as we are particularly interested in letting people know about new attachments. So let’s add a condition.
You can add an issue of having attachments as a condition. And, while adding a component, you’ll be able to choose whether you want to trigger an action based on the attachment existing or not existing.
Now that the conditions are set, we can add our action. You can type in “send email” to find the one you’d want Jira to take.
This will allow you to select who you want to send the email to and edit the subject line and the body of the notification email. Please note that you can use smart values and HTML tags, making sure that the subject and the body of the email will be relevant to the issue that was modified.
That’s it. All that’s left for you to do is to turn the rule on. Now every time an attachment is added to an issue, the user group you’ve selected will receive a notification email.
Jira Automation Examples
Feel free to use Jira automation rules to streamline your processes. Just let Jira handle the tedious and – what’s more important – often overlooked or easy-to-miss things while you do something much more productive with your time.
I’ve prepared some examples of Jira automation use cases to get your creative optimization juices flowing.
Add a Watcher When a Bug Is Created
You can add a watcher from the designated people in your team automatically when a bug issue type is created. You’ll need to set issue creation as a trigger > add issue type equals as a condition and add watchers as an action.
Send Slack Messages as Notifications When Something Fails
Jira has many integrations, with Slack integration being one of them. Another handy automation rule will allow you to send a Slack message as a notification when a deployment to production fails. You can use the Deployment Failed as a trigger and Send Slack message as an action to create this rule.
Automatically Set the Sprint To Current When an Issue Transitions to “In Progress”
Automation allows you to modify fields in issues just as easily as it allows you to trigger an event with an external app like Slack. For instance, you can set up a rule that automatically fills in the Sprint field with the current Sprint when an issue is transitioned to “In Progress” using When: Issue transitioned to as a trigger, Sprint is empty, and Issue Type not one of sub-task, problem as conditions and Edit issue fields: Sprint as an action.
Third-Party Add-on Automation
The best part about the automation Jira offers is that it is not limited to barebones Jira functionality. You can use it with third-party add-ons that support Automation for Jira.
For instance, you can set up your automation while using a Jira Checklist in a way where a certain checklist will be created along with the creation of an issue of a certain type (Obviously, you’ll need Smart Checklist installed at your Jira instance before you can proceed). This is quite handy if, for example, you want to create bug-type issues with test cases already in them.
Create a new rule and set Issues Created as your trigger.
Add a new Condition component.
Choose the JQL component as you set your condition and add your filter per issue type. In our case, this will be issuetype = Bug
Save your condition and add a new action. It should be Set entity property.
Choose entity Issue type: Issue and enter this key when you set the Property key: com.railsware.SmartChecklist.checklist
And finally, add your checklist template using markdown formatting and turn the automation rule on.
That’s it; whenever you create a ticket with an issue type, it will have a checklist inside of it.
Having checklist templates like this one in your issues automatically will save your team from excessive manual work. And it is quite flexible, too – you can set custom statuses, tag people, and set deadlines. The progress is visible at a glance from the progress bar.
Published at DZone with permission of Oleksandr Siryi. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments