Automation rule to Sum up Completed story Story Points in an epic.

@Akshithrekulapelli February 22, 2023

I just created a new custom field called "Completed Story Points" and added to my epic screen. Is there any automation rule to add the story points of all the completed Story's and display them in this field "Completed Story Points". 

3 answers

1 vote
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.
February 22, 2023

Hi @Akshithrekulapelli 

First thing: writing automation rules often involves experimentation.  I recommend you review the documentation and examples, create a test project in which to write and test rules, and to learn about automation.  Once you have a rule working, then copy it to your desired project(s).  Please look here to help you get started:

If after trying to write a rule you have struggles, post images of your rule, the audit log details, and what does not work as you expect.  That will help the community to focus their suggestions.  Thank you.

 

You may do what you ask using the Lookup Issues action, with JQL to reference the issues with the same parent epic.  Please adjust the trigger and JQL to match your use case.

  • trigger: issue transition to done
  • condition: issue type is not epic
  • condition: parent is not empty
  • action: lookup issues with JQL to find issues with the same parent, and which are done
parent = {{triggerIssue.parent.key}} AND statusCategory = "Done"
  • branch: to the epic parent of the issue
    • action: edit your custom field to the sum with
{{lookupIssues.Story points.sum}}

 

Please note: you do not state if you are using a Company-managed or a Team-managed project.  Company-managed projects use the "Story points" field and Team-managed use the "Story point estimate" field, so please adjust the above JQL, as necessary.

 

Kind regards,
Bill

christopher_branaman June 21, 2024

I'm trying to do the same thing (Company Managed/Cloud). I created a new field called Points Complete.

Whenever a card is moved to Done, I would like to see this field in the Epic populated with the total story points of completed cards.

Here's what I have currently - 

When: Value changes for Status

Issue Type does not equal Epic

(I also tried a variant where I added in the Condition And: Parent exists)

Then: Lookup issues
parent = {{triggerIssue.parent.key}} AND statusCategory = "Done"

Branch

For: Parent

Then: Edit issue fields

Choose fields to be set = Points Complete
{{lookupIssues.Story Points.sum|0}}

 

Weird thing is when I look at the audit logs, it doesn't seem like the rule is even being triggered.

Screenshot (93).pngScreenshot (94).pngScreenshot (95).pngScreenshot (96).png

christopher_branaman June 21, 2024

Problem solved. In case anyone else runs into this issue as well.

I realized my error was in Step 1 Field Value Changed.

I selected: 
Status (correct)
any changes to the field value (correct)
Add issue, Edit issue (wrong! correct value here is Transition issue. Now it works like a charm.

christopher_branaman June 24, 2024

@Bill SheboyI have a quick follow-up question on this issue. Is it possible to further drill down/filter completed cards?

For example, the current formula is looking for statusCategory = "Done"

This in turn is pulling all combined cards that would equate to a Done value (.e.g. Cancelled, Duplicate, Not A Bug, etc).

Is it possible to query but custom status value?

0 votes
Najm Polaris
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.
February 22, 2023

@Akshithrekulapelli

You can create a scheduled automation to run a specific JQL which will return the issues for which you want to add the story points. 

Then you can add the story points and return them to the Story point custom field. 

Sum values using smart values  

 

sum.png

@Akshithrekulapelli February 22, 2023

my requirement is when the user stories under the epic are done.

Lets say Epic A has 5 user stories from which 3 are done and two are not done.

so whenever an issue to moved to Done,Rejected Status if the issue type is not epic then add the Story points of 3 user story and display them in "Completed Story Points" Field in Epic. 

can we create an exact automation rule according to my requirements?


Najm Polaris
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.
February 22, 2023

Yes, the automation should be like below

 

Trigger:

  • issue transitioned
    • Any status to Done/Reject

Condition

  • if issue is not epic

Then 

  • Edit issue (Epic story point field)
    • Add the user story point to epic custom field

 

Need to keep another custom filed in Epic to keep the previous sum of story points (Previous Sum) with which the new user story should be added and return the value to epic "Completed Story Points" field. Then update the "Previous Sum" field to "Completed Story Points" again.  Hope  it is not too confusing. 

@Akshithrekulapelli February 22, 2023

I don't know how to add sum of the story points only for the stories which are done.
Can you help me with the rule?
Automation.JPG

0 votes
Jim Doran
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 22, 2023

Not an answer to the above, but just follow up question; is there a JQL to sum up points in general? (hoping this can help answer @Akshithrekulapelli question, not trying to hijack the thread)

Najm Polaris
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.
February 22, 2023

Haven't seen anything with JQL but you can do it using smart values. 

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-math-expressions/

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