Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Get a total of storypoints from "Issue Lookup" action in next action

Wesley Vestjens December 6, 2023

We have an automation that posts a message to Slack when a Sprint starts. It works exactly as we want, however we have one small missing feature for which we're 1) unsure if it's possible at all and 2) if so, how to implement it.

We have an automation that looks like this:

  • When: Sprint started (in "TEAM2")
  • Then: Lookup issues (where `sprint = {{sprint.id}}`)
  • And: Send Slack Message

In the "Send Slack Message" we have a `lookupIssues` template, where the url, key, summary and a custom "Refined Story Points" field is used.

After the `lookupIssues` template, we'd like to do two things:

  • A total for the "Refined Story Points" value
  • A total for the "Refined Story Points" value, but specifically those that are not in "To-do" status, e.g. stories that have been carried over from the previous Sprint.

If it's possible, some assistance in how to achieve this would be appreciated! :)

1 answer

1 accepted

3 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 6, 2023

Hi @Wesley Vestjens 

Yes, those things are possible.

I am assuming "Refined Story Points" is a custom field you have added.  And so the first thing to do is to identify either the smart value or custom field id for that one.  You may use this how-to article to do that: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

The total for that field would be this, substituting in your field's smart value:

{{lookupIssues.yourFieldSmartValue.sum|0}}

I added a default value of zero (0) just in case.

To get the filtered value for those not in the "To-do" status, you may use smart value, list filtering and a math expression, as referenced here: https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588 and https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/

And so the filtered value would be this, substituting in your field's smart value and the exact name of the status:

{{#=}}0{{#lookupIssues}}{{#if(not(equals(status.name,"To-Do")))}}+{{yourFieldSmartValue|0}}{{/}}{{/}}{{/}}

How this works, working from the inside outward:

  • iterating over the lookup issues results
  • filter to only include issues not in the "To-Do" status
  • and add the value for your "Refined Story Points" field, with a default value of 0
  • wrapping all of that with a math expression, with a default value of 0 at the front, in case no issues match the filter

A simpler way to do this would be to use a second call to lookup issues, saving both totals in created variables.  But that would make your rule slower to execute.

Kind regards,
Bill

Wesley Vestjens December 6, 2023

Wow, that's a really extensive answer! Thanks for that. It works like a charm.

Did not expect this to be possible! :D

Like Bill Sheboy likes this
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 6, 2023

Awesome; I am glad to learn that helped :^)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events