In our previous post, we showed you how to automate tasks for Sprint Planning. In this blog we’re going to show you how to test the automation rule, and prevent duplicate sub-tasks from being created. If you prefer, watch the video on ‘Testing The Jira Automation Rule’.
Testing automation rules
Automation rules are a game-changer, automating repetitive tasks and reducing manual efforts. We’ll demonstrate the testing of one such rule and discuss how it can be a real time-saver for your team.
Step 1: Accessing Sample Data for Testing
Before we dive into testing the automation rule, let’s quickly review how to access sample data to replicate the process. If you haven’t already, we recommend watching our video tutorial on this topic, which will guide you through downloading and importing the data.
Step 2: Testing the Automation Rule
Once you have the sample data set up, head over to the Product Backlog view in Jira. Now, let’s test the automation rule. We will take a Product Backlog item and drag it into the Sprint, observing the automated action.
Let’s say we have an item named “Edit Profile” without any sub-tasks. When we drag it into the Sprint, we’ll give it a moment and then take a look. Voila! A new sub-task called “Product Owner Review” has been automatically created.
Step 3: Checking Recent Rule Executions
You might be curious about the automation rules that have recently been executed. To do this, click on “Automatically Create sub-task” under “Recent Rule Executions” on the right-hand side of your screen. This will provide you with a quick overview of the executed rules and their outcomes.
Step 4: Audit Log for Troubleshooting
If you encounter instances where your rules are not running as expected, don’t worry. Jira automation has got you covered with an audit log. To access it, simply navigate back to the automation page, click on the lightning icon, and voila, you have the audit log right at your fingertips. This log is incredibly useful when you’re unsure about a rule’s behavior and need to investigate further.
Potential Issue: Duplicating sub-tasks
While the rule we tested successfully created a sub-task when we dragged an item into the Sprint, there is one potential problem to be aware of. If you drag the same item out of the Sprint and then back in, the automation rule will create another sub-task.
Here’s how to fix it.
How to avoid duplicate sub-tasks being created
Step 1: Revisiting Jira Automation
To fix the automation rule, head back to Jira Automation. Find the rule in question and click on “Edit” to make the necessary changes.
Step 2: Adding a Condition to Check for Existing Sub-tasks
To prevent duplicates, we need to add a condition that checks whether the sub-task “Product Owner Review” already exists for the item. Let’s do this step by step.
- Click on “Add Component” and select “New Condition.”
- Choose “Related Issues Condition” to determine whether a sub-task is associated with the item.
- Opt for “None match specified JQL” as the condition type.
Step 3: Specifying JQL for the “Product Owner Review” Sub-task
In the JQL (Jira Query Language) field, enter the summary of the sub-task you want to avoid duplicating, in this case, summary~”Product Owner Review.”
Step 4: Save and Reorder the Condition
Hit “Save” to preserve the changes. Now, ensure that this new condition is placed before the action that creates the sub-task. This way, Jira will check for an existing sub-task before initiating the action.
Step 5: Publish Changes
Once you’ve made the necessary adjustments to the rule, click on “Publish Changes” to implement the updated automation.
Step 6: Testing the Fixed Automation Rule
Now, let’s put the rule to the test. Head back to the Product Backlog view and choose an item without an existing sub-task. For example, select “List Car for Rent” and drag it to the designated stage.
Check if the automation creates the “Product Owner Review” sub-task. Once verified, drag the item back to its original position and then move it again to the target stage. This time, observe whether the automation successfully avoids creating a duplicate sub-task.
In our next blog, we will be sharing 3 Tips when using Jira Automation for sub-task creation. Follow us on Linkedin for updates.