Forums

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

Summing up story points from Linked tasks to story

ori gal
Contributor
August 14, 2023 edited

I would like to update my Story's cost (story points) with the sum of all the tasks related to it (using "Relates to" connection).

 

Trigger (1 of 2 options):

- Schedual task that runs daily

- When a task is linked to the Story

 

I would like the sum of all the related tasks, to be populated in a a new filed in the Story, called "Total cost"

 

All the articals I found here explains how to do it with Sub-tasks, but its not solving my issues.

1 answer

1 accepted

0 votes
Answer accepted
Mark Segall
Community Champion
August 14, 2023

Hi @ori gal - I would recommend using a different link type.  "Relates To" does not provide a "inbound/outbound" link like "Blocks/Blocked By" which makes it difficult to identify the "source" and "target" issues in automation regardless of whether you're using an Issue Linked or Scheduled Trigger.

If you go with say "Blocks/Is Blocked By", you could do this (note I'm copying the help text from the Issue Linked trigger so you can further understand the importance of the link type):

  • TRIGGER: Issue Linked (Blocks)
    Rule executes when an issue is linked to another issue. {{issue}} will always refer to the source issue, so if ISSUE-A is blocked by ISSUE-B, this rule will execute on ISSUE-B. To access ISSUE-A, use {{destinationIssue}}, and to access the link type, use {{linkType}} (e.g. {{linkType}}
  • ACTION: Lookup Issues
    • issueBlocks = {{destinationIssue}}
  • BRANCH (Destination Issue)
    • ACTION: Edit Issue (Total Cost)
      • {{lookupIssues.Story Points.Sum}}
ori gal
Contributor
August 14, 2023

Hi @Mark Segall ,

 

Thank you for the prompt response!

Im not sure about using "Blocks/Is Blocked By" as it represents a different status. 

Are you saying that useing "Relates to" link will generate the result Im trying to reach?

Also, I dont want to update the Story "Story points" rather a custom filed I've created by the name of "Total cost". can you help me understand how to do it?

Mark Segall
Community Champion
August 14, 2023
Im not sure about using "Blocks/Is Blocked By" as it represents a different status. 

Are you saying that useing "Relates to" link will generate the result Im trying to reach?

It doesn't have to be Blocks.  I was only using that as an example.  Relates To will not work because it doesn't have a clear inbound/outbound reference.  The only way that automation (or JQL) can identify which issue should be the focal point is by having a an understandable inbound/outbound reference which is provided by stock link types like Blocks and Clones.  You could create a custom link type if neither of those work for you, but you'll need something that is clear.

Also, I dont want to update the Story "Story points" rather a custom filed I've created by the name of "Total cost". can you help me understand how to do it?

The rule I provided will sum up the Story Points field from all of the linked issues into the Total Cost field.  If you're wanting to Sum up the Total cost field from all linked issues it would just be changed to this:

{{lookupIssues.Total Cost.Sum}}

NOTE - If your Total Cost field was not created as a Numeric field, you'll need to adjust it to something like this:

{{lookupIssues.Total Cost.asNumber.Sum}}
ori gal
Contributor
August 15, 2023

Thank you Mark!

I wasnt familiar with the 'reference' concept nor with the inbound/outbound.

2 followup questions:

1. How can I know which of the Linked issues  are  inbound and which are oroutbound?

2. How can I create a new type of Linked issues?

Mark Segall
Community Champion
August 15, 2023

1. How can I know which of the Linked issues  are  inbound and which are oroutbound?

Using the Relates To, you won't have that concept which is why using this link type would be challenging, if not impossible.  You'd need some other mechanism for Automation to be able to delineate between which issues are being summed up and which issue will be storing the total.

2. How can I create a new type of Linked issues?

You can access it through Settings >> Issues >> Issue Linking or here:

https://YOURINSTANCE.atlassian.net/secure/admin/ViewLinkTypes!default.jspa

NOTE - You need to be a Jira Admin

ori gal
Contributor
August 15, 2023

I will look into that.

 

1 last question. in the solution you suggested, you used the setup here below.

Any chance you can show me how it should look? Im having issues setting it up.

 

BRANCH (Destination Issue)
      ACTION: Edit Issue (Total Cost)
             {{lookupIssues.Story Points.Sum}}

Mark Segall
Community Champion
August 15, 2023

Sure - Here's a screenshot:

2023-08-15_07-32-09.png

Specifically, for the branch component, you'd select Branch rule/related issues and then select Destination Issue from the dropdown.

ori gal
Contributor
August 15, 2023

it worked great. thank you!

Like • Mark Segall likes this

Suggest an answer

Log in or Sign up to answer