Forums

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

Get Xray Test summary for all tests in a test plan via REST API

Fabian Sturm July 4, 2025

I have a seemingly trivial task. I want to get the summaries of all tests that are associated with a specific test plan in Jira Xray.

Unfortunately, I can't figure it out and I can only get all test keys. I would then have to iterate over each test to retrieve the summary which makes this solution unfeasible due to hundreds of REST calls.

If I look at all test issues in the web interface I can add a column called "Test Plans associated with a Test". There I see the test plan listed.

But if I try to filter for the cutsom field like this: 

project = DEMO AND type = Test AND cf[10210] = "DEMO-123"

I get:

Field 'cf[10210]' does not exist or you do not have permission to view it.

The id of the custom field should be correct, here is what the Jira python API returns:

{'id': 'customfield_10210', 'name': 'Test Plans associated with a Test', 'custom': True, 'orderable': True, 'navigable': True, 'searchable': True, 'clauseNames': [], 'schema': {'type': 'array', 'custom': 'com.xpandit.plugins.xray:test-plans-associated-with-test-custom-field', 'customId': 10210}}]

The Xray REST API itself allows to retrieve tests from a test plan like this:

https://jira-server.com/rest/raven/2.0/api/testplan/DEMO-123/test

But it seems I can't load additional fields during this REST call.

Any ideas how to solve this?

Thanks a lot, Fabian

1 answer

1 accepted

0 votes
Answer accepted
Fabian Sturm July 5, 2025

Nevermind, I found the solution. It is not exposed as a cutom field but a special function. 

See: https://docs.getxray.app/display/XRAY/Enhanced+querying+with+JQL

So I can do the following query:

project = DEMO AND type = Test AND issue in testPlanTests("DEMO-123")

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events