Jira Xray: Access Test Plan Board via REST API

Jonas Küper May 19, 2021

Hello,

is it possible to access the test plan board of the Jira Xray plugin via the REST API of either Jira or Xray itself? I need to get the whole folder structure that I can create on the test plan board using the Jira GUI.

What I have seen so far is only that I can list all tests belonging to a test plan, but unstructured.

1 answer

1 accepted

1 vote
Answer accepted
Jonas Küper May 20, 2021

I just contacted the Xray support about this and they said that this is not possible right now but already has a ticket.

However, for now my workaround is to do send a GET request to

{jira-host}/rest/raven/1.0/testPlanRepository/folders?entityKey={testplan_key}&folderId={parent_folder_id}'

where 'parent_folder_id' is a numeric (Xray-internal) id. Using -1 as folder id gives you the root folder. The results look like this:

{
"folders": [
{
"rank": 1,
"name": "Folder 1",
"hasChildren": false,
"id": 6,
"testCount": 1,
"totalTestCount": 1
},
{
  "rank": 2,
"name": "Folder 2",
"hasChildren": false,
"id": 7,
"testCount": 2,
"totalTestCount": 2
},
{
"rank": 3,
"name": "Folder 3",
"hasChildren": false,
"id": 8,
"testCount": 1,
"totalTestCount": 1
}
]
}

However, this does not seem to be part of the official API and may therefore not work with every version.

Sergio Freire - Xblend
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 24, 2021

@Jonas Küper you're right.  That API endpoint is internal; it's subject to change. There are other private endpoints but they are private and not documented.

For anyone interested, please vote on the feature request .

Regards,

Sérgio

Suggest an answer

Log in or Sign up to answer