All articles
Automation

Five JMWE patterns that keep your workflows out of trouble

The difference between Jira automation that holds up in production and automation that pages you at 2 a.m. — five JMWE patterns worth standardising on.

Jira Misc Workflow Extensions (JMWE) is one of the most capable apps on the Marketplace — and one of the easiest to make a mess with. The features are powerful enough that a workflow grows organically until nobody, including the person who built it, can say with confidence what happens on a given transition.

The difference between automation that holds up in production and automation that pages you at 2 a.m. usually isn't cleverness. It's discipline. Here are five patterns worth standardising on.

1. Make post-functions idempotent

A transition can fire more than once — a retry, a bulk operation, a user double-clicking. If a post-function blindly appends a comment or increments a field every time it runs, those duplicates pile up. Before you act, check state: "is this field already set?", "does this comment already exist?". A post-function that's safe to run twice is a post-function you can stop worrying about.

2. Guard conditional logic against null

Most JMWE incidents I'm called in to fix trace back to a value that wasn't there — an empty custom field, an unassigned issue, a missing parent. Scripted conditions and Nunjucks expressions should assume fields can be empty and handle that case explicitly, rather than throwing and silently blocking a transition. Default values and existence checks are cheap; a workflow that users can't move issues through is not.

3. Prefer shared, named building blocks over copy-paste

When the same logic appears in five workflows by copy-paste, a rule change becomes five edits — and you'll miss one. Centralise reusable logic, give it a clear name, and reference it. Future-you, debugging at speed, will be grateful that "set the SLA target" lives in exactly one place.

4. Validate on the transition, communicate on the screen

Validators should fail loudly and early, with a message that tells the user what to fix — not a generic "transition not allowed". Pair a validator with a transition screen that asks for exactly the data the validator requires. The goal is that a user never hits a wall they can't understand and resolve themselves.

5. Document the intent, not just the config

A screenshot of a post-function tells you what it does. It doesn't tell you why — which business rule it enforces, who asked for it, what breaks if you remove it. Keep a short note (a Confluence page works well) mapping each non-obvious piece of automation to the reason it exists. This is the single highest-leverage habit for any team that wants its workflows to survive a personnel change.

The throughline

Every one of these is really the same principle: assume your automation will run in conditions you didn't anticipate, and design so that the failure mode is safe and legible. That's what separates a workflow you maintain from one that maintains you.

Always validate behaviour against the current JMWE documentation and test in a sandbox or non-production project before rolling changes to live workflows.

Want help putting this in place? I set up and automate Jira, Confluence, JSM and Asana for teams of every size. Book a call.