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

Sum up Story Points from Stories Under Epic (Jira automation)

Janany Satkunam April 17, 2024

I have looked at all the threads related to this issue but so far no workaround for the problem I am seeing.  I have the automation set up as in the attached screen shot.  

https://www.youtube.com/watch?v=PROcxEOMyGM is the video I was following.  In the video it uses action issuetype in (story) and "Epic Link" = "{{issue.Epic Name}}" that didn't work so I changed it to "parent" = {{issue.key}}. However I still see the epic's Story Points field keep getting reset to zero.

Not sure why this is happening.  Please help.

 

SumUpStoryPoints-Issue.png

 

3 answers

1 accepted

0 votes
Answer accepted
Kalyan Sattaluri
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.
April 17, 2024

Hello @Janany Satkunam 

Are your Epics and stories in the same project?

In your lookup JQL, use "Epic Link" = {{issue.Epic Link}}

Before you edit your issue, put a log statement and log the value {{lookupIssues.Story Points.sum}} to verify..

Parent logic is only for cloud.

Janany Satkunam April 17, 2024

Hi Kalyan, Epics and stories are in the same project.  I tried "Epic Link" = {{issue.Epic Link}}. but the issue is still happening.  Epic Story Points field resets to empty.

You mentioned putting a log statement.  Can you give me the steps to do this?  And what are we trying to check with this log statement?

Kalyan Sattaluri
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.
April 17, 2024

Hello @Janany Satkunam 

Log statement just logs values so we know that lookupIssues found related stories of the epic or not. Its easy to understand whats going on looking at audit logs this way.

To do this, add component above "Edit Issue" -> New Action - Type Log in search box, under Advanced, there will be "Log Action". (see screenshot 1). 

Then when you have selected that option, put in {{lookupIssues.key}} and hit save. (see screenshot 2)

image.png

image.png

 

Now, going back to your issue, if Epic Link is not working, most probably your company has renamed the Epic Link to something else. Like "Feature Link". Try that.

If that also does not work, then,

  • Log into Jira using your browser
  • Pick a story (ABC-123) which has Epic (ABC-100) linked to it.
  • Open a new tab in the Edge browser
  • Put in below URL replacing the bolded parts and hit enter
  • https.yourdomain.net/rest/api/2/issue/ABC-123?expand=names
  • You should see a JSON response.
  • Copy paste that JSON in a text editor like Notepad or Notepad++
  • Search for ABC-100 (which is the Epic Key)
  • Find the customefield which is assigned this value. (lets say its customfield_10080)
  • Then thats what you will use in your lookupIssues, like "Epic Link" = {{issue.customfield_10080}}

Seems like a lot of the steps but this is wa way to find custom field values and once you do it, its straight forward. Bookmark that URL for future reference.

Please try and share if any issues. Thanks!

Janany Satkunam April 17, 2024

I did the log statement as. you suggested.  However I don't see any log entry in the ticket.   Where should I see this logged?

 

As for doing the JSON, when I opened the URL with ?expand=names I am still getting the same normal view (not a JSON response).

Janany Satkunam April 17, 2024

Also I can confirm we do use Epic Link which is cf[10008].   But one thing I don't understand is why the Epic's Story Points value get set to zero.  For example, I just updated to a random number and then I went and updated the child story's 'Story Points' field.  As soon as I did that, the parent's story points field got set to nothing.  

 

See attached screenshot from the history tab of the epic.Screenshot 2024-04-17 at 12.26.45 PM.png

Kalyan Sattaluri
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.
April 17, 2024

My hunch is that you have a separate rule which is wiping this field every time it gets updated. Please review your existing rules.

Janany Satkunam April 17, 2024

That's not possible because this is my first rule I am trying out. 

Kalyan Sattaluri
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.
April 17, 2024

@Janany Satkunam 

OK, I just tested. Because you are in Data Center edition, Story Points is not exposed when using lookupIssues. There a limited set of fields we can use this way. Cloud OTOH exposes all fields but unfortunately DC has this limitation.

Your only option is to make a web request call to sum up the story points. If interested in that route, we can discuss next steps.

Janany Satkunam April 17, 2024

HI Kalyan,

I see the below in audit log.  Is this because of the reason you are explaining above?

I do want a solution to achieve my desired output.  Please advise on next steps.

 

Screenshot 2024-04-17 at 4.59.18 PM.png

 

 

Kalyan Sattaluri
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.
April 17, 2024

@Janany Satkunam 

Never mind, I had a typo earlier when I was testing. We can do this simply.

Please make your rule just like I have below and share audit log screenshot if issues.

Thanks!

image.png

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.
April 17, 2024

FYI, here is the suggestion to add those other fields to Lookup Issues for the Data Center version of automation: https://jira.atlassian.com/browse/JIRAAUTOSERVER-877

If it is of any consolation, when Lookup Issues was added for Jira Cloud, it also only had about a dozen fields.  About a year later, all of the remaining fields were added.

Like Kalyan Sattaluri likes this
Janany Satkunam April 17, 2024

@Kalyan Sattaluri I can’t see what you have for the last condition (for the then statement for Edit Issue).  Can you also share that?  
Also are you saying that this should work for DataCenter version?  I thought there was some limitation you mentioned in previous reply. 

Kalyan Sattaluri
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.
April 17, 2024

@Janany Satkunam 

What you have for the edit issue should work. that is assign it the {{lookupIssues.Story Points.sum}}

 

Also, ignore what I said earlier. I had a typo and was mistaken.

Please implement like I have in my screenshot, trigger the rule by changing a story's points and check epic field and share audit log if it does not work.

Janany Satkunam April 18, 2024

Still getting set to zero.  See the audit log below:

Screenshot 2024-04-18 at 6.20.52 AM.png

Janany Satkunam April 18, 2024

Hi Kalyan,  I got it to work!

There are two fields called "Epic Link" and it was using the wrong one.  So I changed the LookUp JQL to cf[10008] = {{issue.Epic Link}}. and it started working.

Screenshot 2024-04-18 at 6.47.07 AM.png

Kalyan Sattaluri April 18, 2024

Great, please accept answer so it helps others in the future thanks 

0 votes
Janany Satkunam April 18, 2024

Right now the rule is only triggering on create or edit actions.  I want the story points field of the epic updated anytime epic link is updated to this epic or if a child is deleted or moved.  Can I accomplish all of this in one action?

Kalyan Sattaluri
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.
April 18, 2024

You can just use "Multiple Issue Events" trigger and choose Issue created, Issue Deleted, Issue updated triggers together and update epic. It should cover all your scenarios. Do note that for for issue created scenario, you need to include an additional Re fetch action because usually the rule does not have all the fields at hand when issue created is the trigger. You could separate that out as a rule by itself and rest, combine them in 1 rule. Hope it helps and as mentioned in below, please accept that answer for future reference. Thanks!

Janany Satkunam April 18, 2024

I accepted the answer for the original issue.  

Can you let me know how use "Multiple Issue Events" for the rule I have?  Also how do I delete a component on the automation rule as currently I don't see an option to do this.  

Kalyan Sattaluri
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.
April 18, 2024

Right now you have field value changed, instead you will choose "multiple issue events" trigger as below.. My suggestion is, keep "Issue created, Issue updated" together and Issue deleted a separate rule.. And add a refetch action step after trigger..

Also, I am not sure what do you mean delete component... As in remove component from issue?

 

image.png

Like Janany Satkunam likes this
Janany Satkunam April 18, 2024

I mean when I am setting up the rule and say I added a condition or action which I now want to remove.  How do I go about doing that on the automation screen.  Even right now, if I want to change the 'field value changed to 'multiple issue events' how do I do that?   I don't see an obvious way.

Kalyan Sattaluri
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.
April 18, 2024

You just hover over the name of the component, see highlighted, you can edit trigger or delete components from there.

image.png

Janany Satkunam April 18, 2024

That is super helpful.  Thank you!  Does the below look right?

Screenshot 2024-04-18 at 10.37.31 AM.png

Kalyan Sattaluri
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.
April 18, 2024

I dont have access to delete issues in my instance so I dont know if re fetch will work for that scenario.. but even if that step errors out, epic will still be updated. Thats why I said to separate Issue deleted as its own rule. You can simply go back to your rule list and copy current one and modify the trigger so it should not be a lot of work,

Finally, one last addition, before refetch,  include an if condition, issue type check and check if issue is a story/task, only then continue with refetch and other steps, cause this rule as it is now will run for changes made to sub-task/epic etc which you dont want...

If you make that change, everything looks good. Try it and share if issues.

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.
April 17, 2024

Hi @Janany Satkunam 

Are you using Jira Cloud?  And if so, are you using a company-managed or a team-managed project?  You may find that information and the bottom-left of the screen expanding area on the page.

Company-managed projects use the "Story points" field and team-managed projects use the "Story point estimate" field...even though the UX typically calls them the same.  For the smart values, the two options would be:

{{lookupIssues.Story points.sum|0}} or {{lookupIssues.Story point estimate.sum|0}}

I added a default value of 0 to the end after the sum.

Kind regards,
Bill

Janany Satkunam April 17, 2024

This is a DataCenter version.

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events