Article examples. All examples use Wobblewood Toy Co., a fictional toy manufacturer. Field names, statuses, and values are illustrative and based on real automation flows in a production Atlassian instance.
Most Jira automation rules start small. A trigger, a condition, an action. Then the business adds a case, then another, and before long the rule is a maze of nested if/else blocks that only its author dares to edit.
This article walks through a different approach that I call data-driven automation flows. Instead of encoding every scenario as branching logic, you describe the scenarios as a JSON data structure. The rule then uses values from the work item, and optionally input collected when the rule starts, to look up what it should do. The flow stays small and generic. The data carries the variation.
The problem: flows driven by heavy branching and conditional logic
Meet Wobblewood Toy Co. Every new toy moves through a product development workflow:
CONCEPT REVIEW → PROTOTYPING → SAFETY TESTING → PILOT RUN → PRODUCTION READY
At each stage, Wobblewood wants a checklist of sub-tasks created automatically. Which sub-tasks depend on two things:
- the Status the toy just entered, and
- its Product Line field.
Three core product lines follow the full process: Plush & Soft Toys, Wooden Toys and Electronic Toys. Everything else, such as Seasonal Novelties, follows a lighter process.
Here's how the original automation flow was built:
- The trigger fires on transition into any of the five statuses.
- An if/else block checks the status again, once per status.
- Inside each status block, a JQL condition (Status changed from X to Y AFTER -10m) checks the "from" status.
- Inside that, another if/else checks whether Product Line is one of the three core lines.
- Each path has its own "Create sub-tasks" action with hard-coded summaries, plus "Create work item" actions for linked records such as Design Sign-off, Product Risk and Pilot Run Sign-off.
- Each path then branches over the created sub-tasks to set a Sub-task Type field by parsing the summary with {{issue.summary.substringBefore(" -")}}.
How it grows
The production rule behind this example managed to reach a 65 step maximum ceiling. Even well-designed automation can expand quickly as each status, Product Line, and exception gets its own path. Over time, that repeated logic becomes harder to reason about and maintain, so automation needs regular refactoring to keep complexity and tech debt in check.
The growth is easier to see in a small rule. Take three statuses (Safety Testing, Pilot Run, Production Ready) and two material types (Timber, Electronics), which gives six scenarios, and build it both ways:
| Branching rule | Data-driven rule |
|---|
Trigger | 1 | 1 |
If/else blocks | 4 (one by status, then one by material inside each status) | 0 |
Conditions | 9 (3 status checks, 6 material checks) | 2 (material type not empty, the guard) |
Create actions | 6 (one per scenario) | 1 |
Variables, logs and branches | 0 | 3 variables, 1 log, 1 branch |
Total | about 20 | about 9 |
Add a third material | +3 conditions, +3 create actions | One new JSON entry, no new components |
Add a fourth status | +1 status branch, +1 if/else block, +2 conditions, +2 create actions | Add the status to the trigger, add its keys to the JSON |
The branching rule grows with statuses × materials. At five statuses and six materials it passes 70 components. The data-driven rule stays at about 9, however many scenarios the JSON holds. The counts are approximate, because the rule editor numbers components differently depending on how blocks are nested. The shape is what matters.
What the sprawl costs
- Repetition. The list of three core Product Lines appears in six separate conditions, in different orders. Adding a fourth line means six edits, and missing one is easy.
- Copy-pasted actions. The four linked-record actions each repeat the same 6–8 field copies.
- Branches that do nothing. Two Safety Test Plan actions sit in an if/else that picks a test lab, but both override the project from the same variable anyway. The branch is redundant and carries a duplicated description template.
- Data hidden in strings. The Sub-task Type field is worked out by parsing summaries, so the summary text is effectively the data store.
- Bugs that hide in plain sight. In a rule this size, nobody notices that:
- a few summaries have a double space before the hyphen, so Sub-task Type gets a trailing space
- two paths forgot the branch that sets Sub-task Type
- a core line skipping Concept Review straight into Prototyping gets no sub-tasks at all
While this can make the rule’s design look worse in hindsight, it is usually a side effect of how branching and condition handling evolve. When a rule needs to cover more scenarios, the natural first response is often to add more branches and conditional checks.
Design note. Automation flows can be designed in many valid ways. There is nothing fundamentally wrong with conditional branching logic, especially when it keeps a rule clear, small and easy to reason about. This article presents data-driven automation as an alternate pattern with particular advantages when the number of scenarios starts to grow.
The idea: let data drive the flow
If you've done any coding, you've probably replaced a long switch statement with a dictionary lookup. Same idea here. Split the rule into two concerns:
- What should happen in each scenario. That's data, held in a JSON structure.
- How to make it happen. That's the flow, written once and generically.
A data-driven rule has three ingredients:
- A key built from work item fields, and optionally from input collected when the rule starts.
- A config: a JSON object that maps keys to what should happen.
- A generic action that loops over whatever the lookup returns.
Adding a scenario becomes an edit to the data, not a new branch.
Anatomy of a data-driven rule
The data-driven column of that table, built out in full, creates Wobblewood's release-preparation sub-tasks. What each toy needs depends on its Material Type and on the status it enters: Safety Testing, Pilot Run or Production Ready.
Here's the whole rule.
1. Trigger and entry condition
- Trigger: work item transitioned to Safety Testing, Pilot Run or Production Ready.
- Condition: Material Type is not empty.
2. Build the key
Two "Create variable" actions capture the parts of the key:
materialType = {{issue.Material Type}}
statusKey = {{issue.status.name.toUpperCase()}}
3. Hold the config
A third variable, config, holds the JSON. Here's a trimmed version:
{
"Timber": {
"SAFETY TESTING": {
"subtasks": [
{
"summary": "Splinter and edge-finish inspection"
}
]
},
"PILOT RUN": {
"subtasks": [
{
"summary": "Pilot batch sanding and sealing"
}
]
},
"PRODUCTION READY": {
"subtasks": [
{
"summary": "Timber supplier certification filed"
},
{
"summary": "Offcut and waste plan approved"
}
]
}
},
"Electronics": {
"SAFETY TESTING": {
"subtasks": [
{
"summary": "Circuit board staging",
"workInstructions": "*Stage boards in the test rig in serial-number order*"
},
{
"summary": "Battery compartment safety test",
"workInstructions": "*Confirm the compartment needs a tool to open. Record screw type:*"
},
{
"summary": "Thermal soak test (if required)",
"workInstructions": "*Run the 4-hour soak cycle. Attach temperature log here*"
}
]
}
}
}
Considerations for setting the JSON config variable
- Where do you retrieve the JSON config from?
- Store the JSON directly in an automation flow variable (simplest).
- Use the “Send web request” action to retrieve JSON; manage web request authentication as needed:
- an external source such as GitHub
- Confluence via the REST API
- Store configuration in Atlassian Assets and retrieve JSON with the “Lookup objects” action (available on JSM Premium or Enterprise).
- Use other integration actions that retrieve JSON within an automation flow.
Guard against missing keys
An audit-log action prints the key and how many sub-tasks it matched. Then a "Compare two values" condition makes sure the lookup actually found something:
{{jsonStringToObject(config).get(materialType).get(statusKey).subtasks.size}} greater than 0
If a material type or status isn't in the config, the size is empty, the condition fails and the rule ends cleanly, without errors or partial work.
5. Loop over the result
An advanced branch ("For each: smart value") iterates over the matched list, with each item available under the named variable subtask:
{{jsonStringToObject(config).get(materialType).get(statusKey).subtasks}}
6. One generic create action
Inside the branch, a single "Create work item" action creates the sub-task:
- Summary: {{subtask.summary}}
- Parent: the current work item
- Shared fields such as Product Line, Product Manager and priority are copied or set once here, for every scenario.
- Work instructions, with a fallback when the data doesn't provide any:
{{#if(exists(subtask.workInstructions))}}{{subtask.workInstructions}}{{/}}
{{#if(not(exists(subtask.workInstructions)))}}*<include your work instructions here>*{{/}}
Usage-based billing: what each run costs
From 3 December 2026, Atlassian bills automation by steps. Triggers, conditions, branches and actions each count when they run, and paths that don't run cost nothing. Create variable, Log action and Lookup work items are free.
That suits a data-driven rule: its scaffolding costs nothing. A Timber toy entering Production Ready runs the trigger, two conditions, the branch and two create actions, which comes to six steps. Setting every field in the create action helps too. A rule that creates sub-tasks and then branches over them to set fields pays an extra step for each one.
Don't expect a dramatic saving, though. A branching rule only pays for the path it actually runs, so the difference depends on how many conditions a run passes through to reach its actions. For a shallow rule it's about even. For a deeply nested one, the data-driven version saves a few steps per run. The bigger wins are the ones above: fewer components, no copy-paste, and gaps you can see in one place.
Designing the data
Choosing your key: status or transition
The rule above keys on the status the work item entered. That's simple and readable, but every entry into a status counts. If a toy fails Pilot Run and moves back to Safety Testing, the Safety Testing sub-tasks are created a second time.
The alternative is to key on the transition itself:
transitionKey = {{changelog.status.fromString.toUpperCase()}}>{{changelog.status.toString.toUpperCase()}}
{
"Timber": {
"PROTOTYPING>SAFETY TESTING": {
"subtasks": [ ... ]
},
"PILOT RUN>SAFETY TESTING": {
"subtasks": [
{
"summary": "Re-test failed pilot items"
}
]
}
}
}
Which to use depends on the situation:
- Status keys suit workflows that only move forward, or work that genuinely needs repeating on every entry.
- Transition keys give precise control. Rework paths can create different work, or none, simply by leaving the key out. The trade-off is more keys to maintain.
Optional properties and fallbacks
Not every entry needs the same shape. In the example, only Electronics sub-tasks carry workInstructions. Because the action checks exists(), an entry can leave out any property it doesn't need and gets the default instead. Adding a new property, such as an assignee hint or a due-date offset, still means one edit to the create action so it reads the property. It doesn't mean a new branch, and entries that don't use it don't change.
Small lookups: a flat map with a default
Not every lookup needs the nested material → status → list shape. Remember the test-lab if/else from the branching rule, whose two paths did the same thing? A one-level map with a fallback replaces it:
productLine = {{issue.Product Line}}
labMap = {"Electronic Toys": "ELAB"}
labKey = {{jsonStringToObject(labMap).get(productLine)|TLAB}}
Electronic Toys go to the electronics lab, and everything else falls back to the general toy lab. That replaces the redundant if/else from the branching rule with a single line.
Robustness tips
- Always guard the lookup. The size > 0 check turns unknown keys into a clean no-op instead of an error.
- Normalise your keys. .get() matches case exactly, so "Safety Testing" won't find "SAFETY TESTING". Apply .toUpperCase() to status names and keep the JSON keys uppercase. Then a status being renamed from "Safety testing" to "Safety Testing" can't silently break the rule.
- Log the config while you build. A log action that prints the key and the parsed lookup result saves a lot of guessing in the audit log. Log actions don't count towards automation usage, so it can stay in after you go live.
- Check the JSON outside the rule. Editing escaped JSON in a variable field is error-prone. Paste it into a JSON validator before saving the rule, and keep a source copy under version control or on a Confluence page.
- Put shared behaviour in the action, not the data. Fields every sub-task needs belong in the generic create action. The data should only hold what varies.
Limitations worth knowing
Sub-task order isn't guaranteed
Advanced branches over smart values run their iterations in parallel. Even though a JSON array is ordered, sub-tasks may be created, and given keys, in a different order. If sequence matters, the simplest approach is to store it in the data (for example a sequence property written into the summary or a number field) and sort by that. If creation order itself matters, top-level actions run sequentially, so a fixed number of create actions reading subtasks.get(0), get(1) and so on can guarantee order, at the cost of a fixed upper limit.
Why not the "Create sub-tasks" action?
The built-in "Create sub-tasks" action does create its entries one after another, which makes it tempting. But its list of entries is fixed in the rule editor. Summaries can contain smart values, but the data can't control how many sub-tasks it creates, and it only sets summary and type. For a data-driven flow, the advanced branch with a generic "Create work item" action is the better fit.
There's a cost trade-off, though. "Create sub-tasks" makes all its sub-tasks in a single step, while the loop pays one step per sub-task. When the list is fixed and no per-item fields are needed, the built-in action is the cheaper choice.
Going further
- User input as part of the key. A manual trigger can collect input when the rule starts, for example a "Release type" choice of Standard or Rush. Fold {{userInputs.releaseType}} into the key and the same rule can create a lighter checklist for rush orders, without another branch.
- Config outside the rule. Any of the sources listed under Hold the config, or a dedicated configuration work item read with Lookup work items, keeps the JSON editable without opening the rule. Process owners maintain the data while admins look after the flow.
- Beyond sub-tasks. The pattern works anywhere a rule chooses between variations: routing approvals, setting field defaults, building notification recipients or choosing which linked records to create.
Wrapping up
Data-driven flows won't replace every condition in your rules, and they shouldn't. But when a rule's complexity comes from how many cases it handles rather than how hard each case is, moving the cases into data pays off quickly: fewer components, no copy-paste, gaps that are visible in one place, and changes that don't need a rule rewrite.
I'd love to hear how others are using JSON and smart values to tame their automation. Share your patterns, or the edge cases that caught you out, in the comments.