How to separate linked issue story points based on the issue type of the linked issue
Asked by Dan Tombs:

Hi Community,

Any help on this would go along way on this.

In our dev team we have the ability to run 10% of each devs time every sprint towards own self improvement, however they must be tracked and prioritised like any other ticket. An report ticket (way of seeing who wants to improve where) would then have the acutal improvement tickets linked (workable items like courses etc.) as well as any stories the devs felt truly improved their skill in this area. Now while I believe we could separate out based on link type I do not want to rely on this as sometimes the devs just select a link type and move on.

Back on the report ticket the manager wants to know how many improvement points (SPs on improvement tickets) vs actual work points are being put towards each report. This is hopefully for use of getting additional course time etc.

I have an automation rule on a schedule that first of all just checks the ticket and compares it to make sure there are linked tickets. Then it will sum up all points from linked tickets using:

```
{{issue.issuelinks.issue.Story Points.sum.floor}}
```

Since the improvement tickets and actual work are different issue types I was wondering whether we would be able to separate and run a only include if linked issues issuetype = X.

I have tried allsorts of combinations including:

```
{{issue.issuelinks.issue.type(improvement).Story Points.sum.floor}}
```

```
{{issue.issuelinks.issue.type.improvement.Story Points.sum.floor}}
```

```
{{#if(equals({{issue.issuelinks.issue.type.improvement}}))}} {{issue.issuelinks.issue.Story Points.sum.floor}} {{/}}
```

```
{{#if(equals({{issue.issuelinks.issue.type}}, "Improvement"))}} {{issue.issuelinks.issue.Story Points.sum.floor}} {{/}}
```

```
{{#if(equals(issue.issuelinks.issue.type, Improvement))}} {{issue.issuelinks.issue.Story Points.sum.floor}} {{/}}
```

Happy to have ideas and comments,

Dan


Answers:
author: Bill Sheboy
body: Hi [@Dan Tombs](/t5/user/viewprofilepage/user-id/4172448)

From what you described, it is unclear what you are doing with those summed values: sending emails, adding comments, updating a field, etc.

If you are updating a field, you may want to use JQL to [find the linked issues by type](https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-functions/#Advancedsearchingfunctionsreference-linkedIssueslinkedIssues--) to use the sum. I suggest that as I do not believe the [smart value list filtering](https://community.atlassian.com/t5/Automation-articles/Filtering-smart-value-lists/ba-p/1827588) you tried can work...it would require loading all of the issues in a tree potentially.

To do this using Jira Cloud, you could use your scheduled trigger on the starting point issues, and then use Lookup Issues to gather/sum with JQL.

With Jira Server/Data Center, you would instead use the bulk handling option for a branch and the {{issues}} smart value to treat them as a set.

Kind regards,  
Bill

comments: author: Dan Tombs
body: Hey @\[deleted\],

Sorry I should have made that clear. Yes we are setting custom field values on the report ticket. Trying to rollup the points effectively.

What would be great is to be able to filter all linked issues based on the issuetype of the linked issue and not the link type. This way you could split out the points to relevant fields without having to rely on devs selecting the right link type.

Dan


author: Bill Sheboy
body: Hi, Dan.

You may add the issueType check to your JQL when you use LookupIssues and so get only that sum. To do this for multiple issueTypes you would need multiple LookupIssues calls.

The other alterative is to gather all the issues with one LookupIssues call, than use both smart list filtering and math operations to sum for each issueType you want.

Thanks,  
Bill


Tags: addon-com.codebarrel.addons.automation

cloud

jira

jira-cloud

jira-server

jira-software