How to get Completed story points, Story point progress in a CF on Epic using Automation jira

saikarthik.chidem July 29, 2021

Fields.PNG

1 answer

0 votes
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.
July 29, 2021

Hi @saikarthik.chidem -- Welcome to the Atlassian Community!

You may do this with custom fields and automation, using Lookup Issues and Created Variable.  For example, if you wanted to do this for all non-done epics the flow of your rule would be something like this:

  • trigger: scheduled trigger with JQL to find all epics which are not done
  • action: lookup issues on JQL to find all children of the epic
  • action: create variable (e.g. named varTotalStoryPoints) for the child count as {{lookupIssues.Story Points.sum|0}} for a Company-Managed Project. If you are instead using a Team-Managed Project, use {{lookupIssues.Story point estimate.sum|0}}
  • action: lookup issues on JQL to find all completed children of the epic
  • action: create another variable (e.g. named varCompletedStoryPoints) for the child count as {{lookupIssues.Story Points.sum|0}} for a Company-Managed Project. If you are instead using a Team-Managed Project, use {{lookupIssues.Story point estimate.sum|0}}
  • action: edit your custom fields to store the results
    • Note for the progress percentage, you will need to use a math expression as created variables cannot be used as parameters to functions.

Best regards,
Bill

Isabella Barbour September 22, 2021

Hi @Bill Sheboy 

I'm trying to do the same thing and was wondering if you could help further?

I get an error when trying to do: 

  • action: lookup issues on JQL to find all completed children of the epic

This is my action:

  •  "Epic Link" = {{issue.key}} AND status = Done

But I get message 'A search during custom value definition found no issues'

And secondly, do you know what the math expression would be? I am using this one below and I get a success message but no figure gets inserted into the field.

{{#=}}{{StoryPointsCompleted.divide.TotalStoryPoints}}{{/}}

Jira.PNG

 

Any help would be greatly appreciated.

 

Thanks

Isabella

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.
September 23, 2021

Hi @Isabella Barbour 

You may want to consider posting your own question (and linking to other posts) in the future.  That will make the post visible to more people.  Thanks!

Would you please post an image of your audit log, expanding the Show More section?  That may provide more details of what is happening.

And, what is the JQL you are using in the scheduled trigger?

 

Okay, on to your specific questions...

For the error you are seeing for lookup issues, what type of project are you using: company-managed or team-managed?  If this is team-managed, please test with "parent" rather than "Epic Link".

Regarding your expression with the created variables, those need to be converted to numbers first.  And, the divide() function appears to do integer math, so try this instead:

{{#=}} {{StoryPointsCompleted.asNumber}} / {{TotalStoryPoints.asNumber}} {{/}}

This is just the division of the values.  If you wanted a percentage, add a multiplier by 100

{{#=}} {{StoryPointsCompleted.asNumber}} / {{TotalStoryPoints.asNumber}} * 100 {{/}}

 

Kind regards,
Bill

Isabella Barbour September 23, 2021

Hi @Bill Sheboy ,

Thanks very much for your reply. I will definitely post separately in the future.

I'm in a company managed project. Here is a snap of my audit log:

JIRA 4.PNG

The JQL for the schedule trigger is:

issuetype = Epic AND status not in ("Done")

Despite this ( 'A search during custom value definition found no issues') all the fields seems to be updating correctly. It looks like "Epic Link" = {{issue.key}} AND status = Done is the problem. But not 100% sure. I use this same lookup to get the story points completed sum in another rule I use, I get the same message but it is summing correctly.

The maths expression worked and I was able to add FLOOR to get the percentage to round down. 

Jira5.PNG

Kind regards

Isabella

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.
September 24, 2021

That is curious, Isabella.

If you take that JQL and run it stand-alone for an example Epic, do you get what you expect:

"Epic Link" = ABC-123 AND status = Done

And...I see another possible thing in your audit log: at least one of those lookup issues calls is finding more than 100 issues, and that is the limit it can return.

Drita Shyti August 30, 2023

@Isabella Barbour , @Bill Sheboy 

I kindly request your assistance in gaining a deeper comprehension of this subject matter.
As a novice user of Jira, I am seeking guidance on how to perform a specific task within the platform. I am interested in incorporating the Jira story into a Confluence page by displaying the percentage of completed tales.
I am currently examining your JQL code, although I am uncertain about my level of comprehension.
In which contexts can the code "Epic Link" = ABC-123 AND status = Done be applied, and what does it signify? What are the methods for replacing it?
I express my gratitude in advance.

Suggest an answer

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

Atlassian Community Events