Accessing linked issues

Can anyone help with accessing he number of linked issues from a jira issue when the “issue” dimension is not in the rows field?

All of the solutions I have seen use the currentMember or currentHirarchyMember to access the linked issues, which does not seem to work when the “issue” dimension has not been selected.

Hi @SaVer

Yes, it is possible to count both the number of linked issues and the number of issue links without having the Issue dimension in the report rows.

Linked issues: the number of issues that are linked to other issues; if one issue is linked to several issues, it is still counted as 1 linked issue.
Issue links: the number of how many links are for issues in project/issue type/etc. If three issues have the same issue linked to, the number of links would be 3.

  1. If you want to get the number of linked issues (by project, for instance), you may create a measure that iterates through all linked issues and retrieves those related to the report context.
    Let’s say linked issues are imported into Linked issues dimension; in the calculation use your linked issues dimension name.
     Descendants([Linked issues].CurrentMember, [Linked issues].[Linked issues]),
    [Measures].[Issues created count]>0

  1. To get the number of issue links, you have to iterate through all issues and access the issue property and count issue links for each issue.
    While this approach uses issue property, the issue dimension is not necessary for the report as the calculation always goes through all issues and accesses each.
   Descendants([Issue].CurrentMember, [Issue].[Issue]),
   Not IsEmpty([Issue].CurrentMember.get('Linked issues'))),
     [Measures].[Issues created]>0
     Len([Issue].CurrentMember.get('Linked issues')) 
     - Len(Replace([Issue].CurrentMember.get('Linked issues'), ',', '')) 
     + 1

Again, please check and use correct linked issue dimension and property name!

As this approach iterates through all issues, it might be slow. If the report with this times out or you need to use it in further calculations, you may consider precalculating this value.
You may check the community thread Question: Counting the Number of Linked Issues where my colleague Lauma advised how to calculate the number of links for each issue during data import, using JavaScript calculated custom field.