How to get number of test cases which are present under user story?

I am using Jira cloud. So the issue is, I’ve created a data which has 3 sprints and in each sprint there are few user stories and under each user story again there are several test cases.
So I need to display the report as how many test cases does each user story consider.
lets say in sprint 1 , user story 1 has 2 test cases I need report in this format

Hi @Babba_Sweety,

In eazyBI, you can import issue links and specify which links and for which issue types to import. And then start to build your report.

  1. First, you might want to import “Linked Test Cases” as separate dimension and property that will contain all tests. The definition for advanced settings might look like this:

    # Linked Tests to Issue
    [jira.customfield_linked_tests]
    name = "Linked Tests"
    #list of possible links in Jira
    outward_link = ["relates to","tests"]
    inward_link = ["relates to","tested by"]
    issue_type = "Test"
    dimension = true
    multiple_values = true
    

    There are more details and examples of how to import issue links: (https://docs.eazybi.com/eazybijira/data-import/advanced-data-import-options/import-issue-links).

  1. During data import, eazyBI will create a new dimension “Linked Tests” and new issue property “Issue Linked tests” that contain keys of tests separated by a comma. For some reports, the new property will be a better solution, and to other reports, the new dimension will do the job. In your case, you might work with the property as individual user stories are on rows.

  2. For your report, define a new calculated measure “Count of linked tests” in Measures, that would count for each user story, how many issue keys are listed in the field “Issue Linked tests”. The formula might look like this:

    CASE WHEN --user story has any linked tests
      NOT IsEmpty([Measures].[Issue Linked Tests])
    THEN --count the commas in the field plus an initial value
      Len([Measures].[Issue Linked Tests])
      - Len(Replace([Measures].[Issue Linked Tests],",",""))
      + 1
    END
    

Best,
Zane / support@eazyBI.com