Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Sum up story points of all issues linked to an Epic

christopher_branaman December 1, 2023

I have seen several posts about this issue but I still haven't been able to get it to work. 

We're on JIRA Cloud

Company Managed Project

I tried 2 different solutions, neither of which worked.

Here is the first  (didn't have room to capture the entire screen but the first steps is the one at the right "Field Value Changed")

Screenshot (43).png

Here is the second one I tried

Screenshot (45).png

In the story points field I used 

{{lookupissues.Story Points.sum}}

Any help would be greatly appreciated.

2 answers

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 1, 2023

Hello @christopher_branaman 

@Jehan Bhathena provided information about a version of a rule that could work for you. I want to address why what you have did not work.

 

To really explain why they didn't work though, I need to know in what way exactly do each of these not work? Without that information I can point out some possible problems.

 

In the first one you have two Lookup Issues actions; one based on something you called "Epic Key" and one based on "Epic Link". What is the one based on "Epic Key" supposed to be doing? Do you have a custom field named "Epic Key"?

Also be advised that the second Lookup Issues action overwrites the results of the first one. If you actually need to retrieve two sets of issues and combine the results; with one issue set based on Epic Link and the other based on Epic Key, those selections need to be combined in one JQL in one Lookup Issues action.

 

In the second rule the Lookup within the branch is wrong. You can't use the Epic Name from the Epic as the value when searching on the Epic Link field for child issues. You would need to use

"Epic Link" = {{issue.key}}

 

Additionally, Atlassian is deprecated the "Epic Link" field and replacing it with the "Parent" field. In many systems they have already disabled the ability to use the "Epic Link" field in screens and filters, or provide warning messages when the "Epic Link" field is used. This may not yet be true in your instance, but you may want to check on that.

christopher_branaman December 1, 2023

Thanks for the response. In both cases (where user error is highly likely) "doesn't work" means that even though the Epics have many child Stories with Story Point values, the Story Points field in the parent Epic cards remain blank.

I will also give your Epic Link suggestion a try.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 1, 2023

I would also recommend that you add a Condition after the Lookup to confirm that the Lookup returned results, and only edit the field in the epin if it did. You can used and advanced compare to compare {{lookupIssues.size}} >0 to confirm that the results set contains one or more issues.

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 1, 2023

Hi @christopher_branaman 

Adding to Trudy's suggestions...

I see several errors in the rule image you posted, with invalid smart values: case and typos.

Smart values are name, spacing, and case-sensitive.  When an invalid one is used, the rule uses null, and that often fails silently (with no error in the log).  The smart value for Lookup Issues is this:

{{lookupIssues}}

And so for a company-managed projects, the sum of the Story Points from the lookup would be this:

{{lookupIssues.Story points.sum|0}}

Please try that in your edit, or write it to the audit log, to observe any differences.

Kind regards,
Bill

Like # people like this
christopher_branaman December 1, 2023

Like this?

{ {lookupIssues.Story points.sum | 0 } }

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 1, 2023

Please remove the extra spaces or the smart value expression will not work:

{{lookupIssues.Story points.sum|0}}
christopher_branaman December 6, 2023

OK so using that formula, it did result in populating the field with a zero. I tried a couple of other different numbers just to be sure. What would be the next step to get all the story points to tally?

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

Let's confirm you are getting any issues back...After the Lookup Issues action, please write this to the audit log with the log action:

lookup issues count: {{lookupIssues.size|0}}

If that logs the count as 0, no issues where found and the JQL needs to be adjusted.

 

With the on-going changes to sunset the Epic Link field, you may want to try changing your JQL for the lookup issues action, based on your rule structure.  Let's assume your rule looks like this:

  • trigger: when value changes for Story Points
  • condition: issue type equals Story
  • branch: to parent
    • action: lookup issues with the JQL of
      • parent = {{issue.key}} AND issueType = Story
    • action: log the value I noted above...
      • lookup issues count: {{lookupIssues.size|0}}
    • action: edit issue to set the Story Points to
      • {{lookupIssues.Story points.sum|0}}
christopher_branaman December 6, 2023

It looks like I've got it working now, thanks! One additional question. Based on the above rules, is it possible to search for Stories AND Bugs?

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

I am glad to learn that is working for you!  Please consider marking this question that Trudy and I helped you with as "answered".  That will help others in the community with similar needs find solutions faster.  Thanks!

 

And...yes, that query could find whichever issue types you search for.  Assuming they all have the same parent, that would be this:

parent = {{issue.key}} AND issueType IN (Story, Bug)

To learn more about creating such queries, I recommend this free training from Atlassian:

https://university.atlassian.com/student/path/849533-gain-project-insights-through-jql

christopher_branaman December 7, 2023

Sorry, last question. Which stage would 

parent = {{issue.key}} AND issueType IN (Story, Bug) be placed?

Would that replace the current query I have for the Then: Lookup issues?

christopher_branaman December 7, 2023

Nevermind, it looks like the following change to Then: Lookup issues did the trick.

issuetype in (story,bug) and "Epic Link" = "{{issue.key}}"

Like Bill Sheboy likes this
0 votes
Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 1, 2023

Hi @christopher_branaman ,

There is a Automation Template for this https://www.atlassian.com/software/jira/automation-template-library#/rule/9919294,  please can you check if this one helps?

christopher_branaman December 1, 2023

No that did not seem to help either

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events