Show the number of Linked Test Cases from the Issue


Add a field that shows the number of test cases linked to an issue.


I work in the QA team and would like to see the number of linked test cases for a given issue, allowing me to quickly see how many tests are related to an issue and filter by this.

Good to Know

  • Use 'Number Field' as the template for the custom script field.


Jira Jira (7.7 - 8.6)

import com.adaptavist.tm4j.api.service.common.ServiceResult import com.adaptavist.tm4j.api.service.tracelink.TraceLinkService import com.atlassian.jira.component.ComponentAccessor import com.onresolve.scriptrunner.runner.customisers.WithPlugin @WithPlugin('com.kanoah.test-manager') final userKey = 'someUserKey' def traceLinkService = ComponentAccessor.getOSGiComponentInstanceOfType(TraceLinkService) ServiceResult result = traceLinkService.getTestCaseTraceLinkCountByIssueId(userKey, result.isValid() ? result.result : 0
Discovered an issue? Report it here

Suggested for you

Appears in these Collections