Page History
You can manage Tests directly through the Jira REST API.
Table of Contents | ||
---|---|---|
|
Children Display |
---|
Creating and Editing Tests - Jira REST API
Xray Test issues can be created and edited though the Jira REST API.
Info | ||
---|---|---|
| ||
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:
- Test Type (default Jira select field)
- Cucumber Test Type (default Jira select field)
- Cucumber Scenario (default Jira text field)
- Manual Test Steps (JSON format; example below)
Info |
---|
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 |
"Manual Test Steps" custom field value format
Code Block | ||
---|---|---|
| ||
{ "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.
Expand | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||
|
Exporting Tests
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.
Expand | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||
|
Getting all Tests statuses
It is possible to get all Test Statuses available in Xray sorted by rank.
Expand | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||
|
Exporting Test Runs
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.
Expand | |||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||
|
Exporting Test Pre-Conditions
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
Expand | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||
|
Exporting Test Sets
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
Expand | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||
|
Exporting Test Executions
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
Expand | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||
|
Exporting Test Plans
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
Expand | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||
|
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.