You can manage Tests directly through the Jira REST API.
Xray Test issues can be created and edited though the Jira REST API.
https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Create+Issue https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+Example+-+Edit+issues |
All Test issue custom fields provided by Xray can be modified using the Jira REST API:
The custom field IDs can be obtained using the Jira REST API Browser tool included in Jira. Each ID is of the form "customfield_ID". Another option, which does not require Jira administration rights, is to invoke the "Get edit issue meta" in an existing issue (e.g., in a Test issue) as mentioned here. Example: GET http://yourserver/rest/api/2/issue/CALC-1/editmeta |
{ "fields": { "customfield_10004": { "steps": [ { "index": 0, "step": "Step 1", "data": "input Data 1", "result": "Excepted result 1" }, { "index": 1, "step": "Step 2", "data": "input Data 2", "result": "Excepted result 2" }, { "index": 2, "step": "Step 3", "data": "input Data 3", "result": "Excepted result 3" }, { "index": 3, "step": "Step 4", "data": "input Data 4", "result": "Excepted result 4" } ] } } } |
Below is a full Test creation example using Jira's REST API endpoint for creating issues.
|
To export tests to JSON, you need to specify the keys, the ID of the filter or JQL query of the issues you want to export. At least one query parameter has to be specified, but all 3 can be sent at the same time.
|
It is possible to get all Test Statuses available in Xray sorted by rank.
|
To export the test runs of a Test, you need to specify the key of the Test you wish to export the test runs from. You can filter the Test runs by Test Environment.
|
To export the pre-conditions of a Test, you need to specify the key of the Test you wish to export the test pre-conditions from
|
To export the test sets of a Test, you need to specify the key of the Test you wish to export the test sets from
|
To export the test executions of a Test, you need to specify the key of the Test you wish to export the test executions from
|
To export the test plans of a Test, you need to specify the key of the Test you wish to export the test plans from
|
To export the test sets of a Test, you need to specify the key of the Test you wish to export the test sets from