Usage of the Refetch component in Jira Cloud Automation rule

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

To ensure your automation rules always use the most current issue data, use the "Refetch issue" component.

Diagnosis

When an issue is updated mid-rule, for example, by an "Edit issue" step, subsequent steps may not reflect those changes. The "Refetch issue" component retrieves the latest issue data, ensuring all actions based on that data are accurate and up-to-date.

Cause

Automation caches the state of an issue at the start of the rule execution. Hence, even when the issue is updated during the process of rule execution the state remains the same throughout the execution of the rule.

Solution

After using the Edit issue action for the first time, use the "Refetch" action component right before the step where you would like the second action to be performed on the same issue. In the below example, we only use the Edit issue action for the demo, but the Refetch component can be used before any Action (or) Condition components to get the latest state of the issue. This can also be used inside Branches.

Example: Let's assume you have an automation rule with an Issue Created trigger and two Edit issue actions. Both of these actions edit the number field name "QL."

1. The first Edit issue action increases the QL field by 3.

The rule triggers when an issue is created, then edits fields twice. The second edit uses the expression "{{issue.QL}} + 3".  Options for choosing fields and more options are available. "Cancel" and "Save" buttons are visible.

2. The second Edit issue action increases the QL field by 1.

"When: Issue created". "Then: Edit issue fields" and "And: Edit issue fields". The edit is using QL and the example shown is to add 1 to the existing value of the issue.QL field.

3. Now, when you create an issue with QL value 0 and the rule runs, the first Edit issue action increases the QL by 3 and the second Edit issue action increases the QL value again by 1.

4. The total values should be 4, but if you check the QL field, you will see the value is only set to 1. This is because the issue's state hasn't been refreshed from the start of the rule execution.

5. Now, we add the "Refetch" component before the second Edit issue action and trigger the rule again.

Automation rule configuration screen. The rule is triggered "When: Issue created". The actions are "Then: Edit issue fields" using QL, "And: Re-fetch issue data", "Add component", and "And: Edit issue fields" using QL.

6. Create a new issue with the QL value 0. Once the rule runs, the QL value is updated to 4.

Updated on April 9, 2025

Still need help?

The Atlassian Community is here for you.