Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

New automation smart values in Jira Cloud

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.

 

Warning! This blog is targeted towards Jira automation power users. We get into the real nitty gritty. If you are just getting started with automation, you can check out our beginners or advanced webinar. This new functionality is only available natively in Jira Cloud.

What are smart values?

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!

What did we do?

ed80957b-6d7c-4113-80ce-01e3abcc7af6.png

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.

Sum, average, max, min

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.

94809239-fbdf-4e53-bf14-39c0753829bd.png

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.

Basic conditions if, equals, not, and, or

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.

2594c4a8-fe37-4938-a91e-1ad409196ed4.png

Chainable basic number operations, plus, minus, multiply, divide, diff

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!

New date-time functions

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:

  1. Set the End Date field based on the SLA during ticket creation

  2. Assign tickets to different agents based on business hours left

  3. 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.

Summing it all up…

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!

Where can I learn more?

20 comments

Hi

I have used the automated Sum function to update the parent cases remaining estimate field when the child case is updated.  It is changing the time I have recorded as seconds but then saving this as hours.  Eg. I have put 2 days remaining on the child case and it has saved this as 36,000 hours remaining against the parent case.

Thanks

Lucy

Like Dharmesh Barot likes this

Are there any plans to enable the business hours (and days) functions be relative to a time zone attribute? For our use case, we want the business hours offset to be relative to the assignee's time zone.

 

Facing similar issue as @Lucy Cookney 

I am trying to sum up remaining estimates of all issues in the parent epics remaining estimate field. I received the following answer from customer support:

"Unfortunately Automation cannot sum up time tracking of child issues to their parent Epic. We do have a solution now for sub-tasks, described in New automation smart values in Jira Cloud, so hopefully we will have summing up to Epics too in the future."

Is this already on the list?

Like # people like this

I am a +1 on the request from Anja above. I would like to traverse the Epic child Story items to add up the story points and apply to the Epic.

Hey @Mark Chaimungkalanont 

 

I've been trying to combine the lookup issues and sum function but not got it to work. Are we limited to using the sum function in subtasks to parent issue? 

Use Case: 

Trigger Schedule -> Action lookup issues (JQL returns Stories created in last X days) -> Action create an email and in the body sum the Story Points of the Stories returned in the list. I've tried the following: 

  1. {{lookupissues.Story Points.sum}} 
  2. {{lookupissues.issue.Story Points.sum}}
  3. {{lookupissues.customfield_10022.sum}}
  4. {{lookupissues.issue.customfield_10022.sum}}
  5. {{lookupissues.issue.fields.customfield_10022.sum}}

Thanks

T. 

Like # people like this

Tom's comment above would unlock precisely the kind of functionality and versatility that would really make this feature sing. A limitation from parent to subtask isn't just arbitrary; it's not really how typical Scrum works.

Story points aren't tracked at a subtask level. Subtasks typically define implementation steps and other details, but story points are a holistic measurement of the parent ticket.

For the use-case described in the post to really be meaningful, story point summation should be based on an Epic which contains multiple pointed stories, OR (ideally) a queried set of tickets, as defined by a "JQL Matches" trigger component.

Is anything like this on the roadmap? Mathematical operations are a wonderful addition, but the current feature, as-implemented, seems like only a half-measure.

Thanks,

Like # people like this

I'm also looking for what Tom mentioned. Sum or average of a number field of all resulting tickets of a lookupissue JQL query, such as story points. The below script returns 0.0 instead of the expected math value.

 

{{lookupIssues.customfield_13813.average}} <- smart value script that would insert the calculation into the 1st line in the below sample email report:

Screen Shot 2020-10-12 at 7.48.33 PM.png

@Mark Chaimungkalanont 

Like # people like this

@Mark Chaimungkalanont 

The example in the screenshot in this article showing how to check a string against a field's value (repeated below) does not work anymore. Did the team change the format? I can't find any documentation about this on the official site.

{{#if(eq(issue.issuetype.name, “Bug”))}} Content {{/}}

Like # people like this

Hi all,

An update on yesterday's issue.

I reached out to support and they sent me the following:

{{ #if(eq(issue.issuetype.name, "Task")) }} This is a task {{ / }}

Which to my surprise worked! I tried it formatted like the one from this article again to understand why:

{{#if(eq(issue.issuetype.name, "Task"))}}This is a task{{/}} 

And it once again did not work. Turns out, you MUST put a space in front of #if and the / in the closing mustache, like so:

{{ #if(eq(issue.issuetype.name, "Task"))}}This is a task{{ /}}

A bit strange because I haven't seen spacing like that affect the completion of a smart value, but hey, I'm glad I can use it now.

@Mark Chaimungkalanont  @William Sheboy 

@Tom Williams @Chad MCCanna 

They might have updated something, but what you're looking for does work at the present moment. However, you must capitalize the "I" in "lookupIssues" like so:

{{lookupIssues.Story Points.sum}}

@Alice Sheng 

The problem you're running into is that customfields aren't supported with a lookup yet. Only the following fields will work:

Available properties:

  • {{key}} - Returns the issue key

  • {{url}} - Returns the issue url

  • {{summary}} - Returns the issue summary

  • {{assignee.displayName}} -  Returns the assignee

  • {{reporter.displayName}} -  Returns the reporter

  • {{status}} - Returns the status

  • {{issueType}} - Returns the issue type

  • {{resolution}} - Returns the resolution status

  • {{fixVersion}} - Returns the fix version

  • {{created}} - Returns the date the issue was created

  • {{updated}} - Returns the date the issue was updated

  • {{Story Points}} - Returns the story points for the issue (classic Jira Software)

  • {{Story point estimate}} - Returns the story points for the issue (next-gen Jira Software)

Documentation 

Like # people like this


@ Mike: If I'm understanding your use case correctly, you can use something similar to the following:

{{now.convertToTimeZone(assignee.timeZone).plusBusinessHours(-3)}}

 

Like Mike likes this

Hello,

@Massis Shahmirian  I try to set some condition in my email automation but it doesn't work : 

1/  i create a lookupissues block with my jql request (return multiple tickets)
2/ in my email i put : 

{{#lookupIssues}}
{{status}}
{{/}}

it works : sending me the status of every lookupIssues


if i try to add conditions : 

{{#lookupIssues}}
{{ #if(eq(status.name, "10001")) }} {{key}} is a done ticket {{ / }}
{{ #if(eq(status, "10001")) }} {{key}} is a done ticket {{ / }}
{{ #if(eq(status.name, "10002")) }} {{key}} is a TODO ticket {{ / }}
{{/}}

It always returns the 3 conditions as true :

DTSIN-61 is a done ticket
DTSIN-61 is a done ticket
DTSIN-61 is a TODO ticket
DTSIN-60 is a done ticket
DTSIN-60 is a done ticket
DTSIN-60 is a TODO ticket
...

it seems the condition is not considerate

My goal is to send a mail like : 


Done tickets : 
list of done tickets

TODO tickets :
list of todo tickets


Do you have any ideas about this issue or other solution to do this ?


thanks,

@jeremy thebault 

Unfortunately, as far as I can tell, conditions don't work inside a lookup. There is a work around for what you're trying to achieve though!

 

You'll have to do the following:

1. Lookup action to grab the issues in a particular status, such as:

project = "POL" and statusCategory = "To Do"

2.  Create a variable to hold the information from the lookup action. You can do so by entering the following as the contents of the variable:

{{#lookupIssues}}{{#first}}<ul><li>{{key}} {{summary}}</li>{{/}}<li>{{key}} {{summary}}</li>{{#last}}<li>{{key}} {{summary}}</li></ul>{{/}}{{/}}

Note: The above includes HTML that will create a bulleted list in your email.

 

At this point, you need to repeat steps one and two to create a separate variable to hold the information from a lookup action that retrieves issues that have a "Done" status.

Then you'll be able to call both the variables in your email which should enable you to create two bulleted lists: one for issues in a "To Do" status and one for issues in a "Done" status.

Like Jeremy THEBAULT likes this

@Massis Shahmirian 

Wow it works perfectly, thanks for sharing this work around .


Thanks again for your help.


Happy Christmas and New Year !

G subramanyam Community Leader Jan 19, 2021

Great stuff. Thank you for the article and the post @Mark Chaimungkalanont 

Hi @Mark Chaimungkalanont, Do you know if there are any plans on bringing these features to Datacenter versions? We would love that! Thank you

@Massis Shahmirian do you know if your recommendation for Tom and Chad

{{lookupIssues.Story Points.sum}}

 

also works for Next Gen Jira
I've been trying different variations of this, but I can't get it to work.

{{lookupIssues.Story point estimate.sum}}

@Enrique Gutierrez 

This works for me. It adds 5 + 5 together for 10.

image.png

@Massis Shahmirian thanks!

I finally managed to set this up.

On change of a task or bug, the Story Point Estimate of my Epic (Jira Next Gen) gets changed to the remaining story points of the epic's children.

 

Screenshot 2021-02-18 180421.png

Like Massis Shahmirian likes this

Comment

Log in or Sign up to comment
TAGS
Community showcase
Published in Jira Automation

Announcing the Jira automation template library!

Hi all,  After many months of work, I am delighted to announce the launch of the Jira Automation Template Library!  The Template Library is a new website dedicated to all things Jira au...

996 views 17 25
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you