I am happy to announce that Jira has just gotten a new powerful feature, which you can start using right now!
Jira expressions is a way to evaluate custom code in the context of Jira entities. It’s a domain-specific language designed with Jira in mind. All Jira expressions are evaluated on the Jira Cloud side. There are currently two ways to use Jira expressions:
- REST endpoint: POST /api/2/expression/eval (a detailed description of the language is included in the docs)
- Web condition: jira_expression
The REST endpoint can be used to test the expressions that you plan to use elsewhere, or to load data in a new flexible way. For example, if you wanted to build an efficient and lightweight visualization of issue comments, you could fetch a minimal required set of data (id, author and the content excerpt) with the following expression:
issue.comments.map(c => [c.id, c.author.key, c.body.plainText.slice(0, 200) + '...'])
The web condition gives you almost infinite control over the visibility of your web elements. For example, you could use the following expression to show your panel only if the current user commented on the current issue:
issue.comments.filter(c => c.author.accountId = user.accountId).length > 0
These are just two simple examples. I’m sure you can come up with something even more useful.
Looking forward to hearing your feedback and seeing all the amazing things you will be able to build with this!