You can manage (i.e., create, update, delete) Test Sets directly through the Jira's native REST API.

The Xray REST API provides the following endpoints.

Test Set Tests


Return a json with a list of the test associated with the test set.

Request

PATH PARAMETERS
parametertypedescription
testSetKeyString

- key of the test set.

curl -H "Content-Type: application/json" -X GET -u admin:admin http://yourserver/rest/raven/1.0/api/testset/TEST-123/test

Responses

200 OK : text/plain : Successful. Return a json.


The "rank" and "key" will clearly identify the Test and its order within the Test Set. Note that the output may currently return other fields, which may only be available in a explicitly detailed request in a future release.

[
   {
      "id":13602,
      "rank":1,
      "key":"CALC-44",
      "self": "http://jiraserver/rest/api/2/issue/10401"
   },
   {
      "id":13600,
      "rank":2,
      "key":"CALC-42",
      "self": "http://jiraserver/rest/api/2/issue/10402"
   },
   {
      "id":13886,
      "rank":3,
      "key":"CALC-66",
      "self": "http://jiraserver/rest/api/2/issue/10403"
   }
]

400 BAD_REQUEST : text/plain : Returns the error.

401 UNAUTHORIZED : text/plain : The Xray for JIRA license is not valid.

500  INTERNAL SERVER ERROR : text/plain : An internal error occurred getting the tests.

Associate tests with the test set. Return error messages, if there are any.

Request

PATH PARAMETERS
parametertypedescription
testSetKeyString

- key of the test set.

Example
{
	"add": [
		"CALC-14",
		"CALC-29"
	],
	"remove": [
		"CALC-15",
		"CALC-50"
	]
}
curl -H "Content-Type: application/json" -X POST -u admin:admin --data @example.json http://yourserver/rest/raven/1.0/api/testset/TEST-123/test

Responses

200 OK : text/plain : Successful. Returns error messages if there are any.

["Test with key CALC-29 is already associated with this Test Set."]

400 BAD_REQUEST : text/plain : Returns the error.

401 UNAUTHORIZED : text/plain : The Xray for JIRA license is not valid.

500  INTERNAL SERVER ERROR : text/plain : An internal error occurred associating the tests.

Remove test from the test set.

Request

PATH PARAMETERS
parametertypedescription
testSetKeyString

- key of the test set.

testKeyString- key of the test.
curl -H "Content-Type: application/json" -X DELETE -u admin:admin http://yourserver/rest/raven/1.0/api/testset/TEST-123/test/TEST-321
Responses

200 OK : text/plain : Successful.

400 BAD_REQUEST : text/plain : Returns the error.

401 UNAUTHORIZED : text/plain : The Xray for JIRA license is not valid.

500  INTERNAL SERVER ERROR : text/plain : An internal error occurred removing the test.