Forums

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

Automation rule to Sum up total story points in an Initiative

Francis Calderisi September 6, 2024

Good afternoon :)

I have created an automation rule the looks up all the child issues of an Epic then totals up ({{lookupIssues.Story Points.sum}}) and stores the result in the Story Point field of said Epic.

 

Currently I am trying to do the same for an Initiative with no success.  Same rule, same JQL to find child issues.  When I check the Audit Log the "Lookup issues" step says "A search during custom value definition found no issues."

Screenshot 2024-09-06 at 11.29.39 AM.png

When I run the JQL from the JQL query line I get 61 results.

I am having trouble understanding why this works for Epics but not Initiatives.

 

Any ideas or thoughts would be much appreciated.  Thank you.

Screenshot 2024-09-06 at 11.26.01 AM.png

Screenshot 2024-09-06 at 11.28.21 AM.png

2 answers

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Champion
September 6, 2024

Hello @Francis Calderisi 

Welcome to the Atlassian community.

Can you show us the results of the JQL query using the issue key shown in the log? I want to see the Issue Types for the issues in the results. The other information can be obscured.

Francis Calderisi September 9, 2024

Hi Trudy,

 

This is what I am getting...

Screenshot 2024-09-09 at 11.17.49 AM.png

It is a mix of Story, Task, Bug and Epic issue type.

Thank you

Trudy Claspill
Community Champion
September 9, 2024

Hello @Francis Calderisi 

What is the Scope of the rule from the Rule Details page?

The Lookup Issues action is able to retrieve issues only from the projects that are listed in the rule Scope.

I notice that the issue that triggers the rule in in the RM project. In the image you provided from the Issues screen I see that the issues being retrieved are in other projects. In order for the Lookup Issues action to retrieve those issues you will have to make the rule a Multiple Project Scope rule and name each of the projects that might have an issue under the hierarchy of the RM issue. Or you can set the project Scope to Global to search all projects in Jira.

You might then want to add Conditions after your Trigger to ensure that the rule will continue only when the trigger is activated by changes in your intended source project vs. all the projects in scope.

Francis Calderisi September 9, 2024

Thank you so much @Trudy Claspill, I was not aware of this...

I will give it a try and see if this fixes my problem.

 

The other issue I imagine will sometimes come up is if their are more than 100 child issues.  I saw in some documentation that the Lookup Issues can return "up to" 100 results.

But first lets get some results :) 

Thanks again Trudy for the valuable insight.

Trudy Claspill
Community Champion
September 9, 2024

That is correct. That limitation is documented here:

https://support.atlassian.com/cloud-automation/docs/automation-service-limits/

One way to work around this would be to:

1. Update the sum stored in the initiative to 0 at the beginning of the rule. Then re-fetch the issue.

2. Use a Lookup Issues action that is more constrained; for example limit it to a particular issue type for the retrieved children. Find ways to constrain the results to less than 100 issues.

3. Edit the Initiative to add the sum from those issues to the current sum value (which is 0) in the initiative. Then re-fetch the issue.

4. Use another Lookup Issues action to get another set of issues, ensuring that the criteria does not overlap the first Lookup Issues action.

5. Edit the Initiative to add the sum from those issues to the current sum value (which is currently the sum from step 3) in the initiative. Then re-fetch the issue.

Repeat steps 4 and 5 until you have covered all possible child issues of the initiative.

 

0 votes
John Funk
Community Champion
September 7, 2024

Hi Francis - Welcome to the Atlassian Community!

If you put the lookupIssues code into the Advanced search function and then use the value of the Initiative key - does it return anything?

In other words, execute this as a filter:

 

issue in portfolioChildIssuesOf("RM-263")

Francis Calderisi September 9, 2024

Good morning John,

Yes, when I execute the JQL in the Advanced Search it returns 61 issues.

 

Which is why I am surprised that the lookup issues is giving me the message that no issues were found.

John Funk
Community Champion
September 9, 2024

Then it's probably related to the scope of the rule. Try changing it to a Global Rule and see if it returns issues in the lookup. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events