Hi Atlassian community,
Mark here, Dev Manager for the Automation team. We have just shipped long-requested new functionality for automation smart values that we think will please power users immensely. Amongst the many use cases it solves is the ability to sum up story points of subtasks and new date / time functionality.
Before we get into the nitty gritty, let’s have a quick refresh. Smart values allow you to access and manipulate almost any data from Jira. They are a great way to supercharge your basic no-code automation rules. You can access just about any value available through the Jira REST APIs and more importantly, you can use functions to transform strings, dates and various other types into almost any format you want.
But power users were always hankering for more and we’ve heard your call!
Well, we managed to attack the 3rd and 12th highest vote-getters in our public tracker. All up, we’ve resolved 188 votes over 24 tickets! Everything ranging from aggregation functions to extra date manipulation, we’ve got you covered.
The #1 use case here that people have really wanted, is to sum up story points of subtasks - now you can with a simple smart value like {{issue.subtasks.Story Points.sum}}. You could use this smart value in the Edit issue action, comments, Slack messages, etc.
At the moment, this will only work for summing up the story points of subtasks. It will not work for summing up the story points of an epic.
That’s it! You can do similar tricks like {{issue.subtasks.Due date.max}} to set the parent’s due date to the latest of the subtasks' due dates.
A bit more controversially, we’re adding some logic to logic-less templates. Why? At some point, use cases like emailing out Release notes and Notifications will require basic logic to do the simplest things. You might want to show a different icon depending on the field value, for example. You also have comparators like gt, lt, gte, let on number fields so can use the logic to match numerical ranges.
One of the quirks was that while you could relatively easily chain date operations together, it wasn’t really possible to chain numeric operations together. Now with operations on Number objects themselves, you can do some pretty complex stuff. If you wanted to do things like setting a “Due date” as a formula of the Story points, you now can! Just set the due date to:
{{issue.created.plusBusinessDays(issue.Story Points.multiply(3))}}
The options here are limitless!
You can now play around with timestamp fields by adjusting fields at hour level. For that, you have two new functions in your pocket: plusBusinessHours and minusBusinessHours. We wanted to take business hours window dynamically from Jira Service Desk, but for now, we assume business hours are 9 AM to 6 PM, Monday to Friday. A few typical use cases can be:
Set the End Date field based on the SLA during ticket creation
Assign tickets to different agents based on business hours left
Set/change priority level based on a deadline
It can be combined with any of the above mentioned basic number operators or condition functions so there are loads of options to exploit. Using these new functions is very similar to plusBusinessDays/minusBusinessDays functions. Just like this:
{{issue.created.plusBusinessHours(issue.Story Points.divide(2))}}
These functions can take negative values, like:
{{issue.fieldName.plusBusinessHours(-3)}}
These functions can be used anywhere while editing fields in action, inside email bodies, just like you have been using plus/minus functions.
So hopefully you’re going to find all the new smart value functions useful! If you have any feedback or suggestion, feel free to post your questions right here in the brand new Automation community space!
New to automation - watch our getting started with automation in Jira webinar
Like more advanced stuff? Join our webinar how to supercharge your automation in Jira Cloud
Mark Chaimungkalanont
27 comments