Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Jira Expressions - But Why?

If, like me and countless others, you're coming to Jira Cloud after years of working on Jira Server or Data Center. One of the first things you might run into is the fact that your favorite old plug-ins (fine, apps, add-ons, whatever Atlassian is calling them today) you used to use to create workflow validators or conditions don't work quite the way they used to.

I'm talking about stalwart standbys like Jira Workflow Toolbox, Jira Miscellaneous Workflow Extensions, Power Scripts and ScriptRunner.


So here's the deal: Atlassian changed things up. Now the only way that plug-ins can provide validators and conditions is via a tricky language called Jira Expressions.

It's syntax is kind of Javascripty (so says @Radhika Vijji _Innovalog_), but if you're like me, and don't know much Javascript (or run screaming from it), it can be a tough learning curve.  

Luckily some add-ons provide handy templates (Cloud Workflows, and Power Scripts) that you can then tweak, or include a helpful editors and testers (Cloud Workflows, JMWE and JWT). But inevitably, you're going to have to get in there and figure it out yourself.

Bottom line:

If you want to use custom workflow validators or conditions on Jira Cloud, you're going to have to learn Jira Expressions.


At its simplest, you might need to do something like "Only the Reporter should be able to close a ticket". So that expression would be:

user == issue.reporter

(That's from JMWE's Use Cases.)

Or maybe you need the old "Check for unresolved sub-tasks" condition before you let a user resolve a parent:

issue.subtasks.filter(s => !(s.resolution != null)).length == 0

(That's from JWT's Use Case Library.)

You can even check links:

.filter(link => link.type.inward == "is blocked by" ||
  link.type.inward == "is mitigated by")
.length > 0

Even more examples

There's a lot you can do with Jira Expressions, and you're going to "get" to learn Boolean logic which is... some kind of fun. But for sure, the best way to learn is by doing. Check those links above, as it's very likely there's an existing "recipe" that can be adapted to your use.

But if you're really stuck, post here in the forums (tags: cloud, jira-cloud, jira-expressions), where some of us apparently have nothing better to do but than to debug others' Jira Expression issue. (Or in some cases like @David Fischer _Appfire_ maybe they get paid for it. :-)


Nice summary, @Darryl Lee !


P.S. I actually don't get paid for helping, but as the creator of JMWE and JMCF, I do care about users making the most of the apps...

Like # people like this
Darryl Lee Community Leader May 16, 2021

@David Fischer _Appfire_ yes, I meant that tongue-in-cheek since I know JMWE is your baby. :-}

Like Dave Liao likes this

Thanks for pointing this out. 

Very cool and comprehensive write-up, @Darryl Lee! And I feel you, you will have to learn it because there's no way around it. I struggle with it myself, but luckily there is help. 😁

Jack Brickey Community Leader Jun 13, 2021

Thangs for sharing. One thing to note about Cloud here - you can install the Workflow plugin and achieve a lot of capabilities in your workflow. App key - com.atlassian.jira.plugin.system.workflow

Like # people like this

Very nice, thanks for sharing


Log in or Sign up to comment

Atlassian Community Events