- Introduction
- About
- Onboarding
- Getting Started
- Demo backup
- User's guide
- Projects' organization
- Test design
- Test Repository
- Test planning
- Test execution
- Requirements
- Operations
- Reporting and tracking
- Import/Export TCT
- Export test issues
- Issue search dialog
- TestFLO menu
- Admin's guide
- Project configuration
- Test Automation configuration
- TestFLO settings
- TestFLO Permissions
- Custom fields
- Advanced workflow configuration
- Panel Filter Result
- REST API
- Upgrade reports
- Upgrade guide
REST API
This section provides information on how to use the REST API with TestFLO elements.
You can use the Jira REST API to perform such operations as:
- Create Test Case Templates and Test Plans
- Change status of Test Case and Test Plans
- Update fields on your TC, TP
- Attach test result to TC
- and Others
Since TestFLO 8.1 version the URL pattern has been changed to $jira_context/rest/tms/1.0/api/$api_endpoint. The old URL pattern is compatible but we recommend changing to the new pattern.
Below you can find the public TestFLO REST API with following endpoints:
Change Steps status
This endpoint allows you to change the status of the step. Body request should be passed as JSON.
Method: PUT
URL: $jira_context/rest/tms/1.0/api/steps/status
Body request properties:
- issueId (ID issue number in which the status in the Steps has to be changed)
- rowIndex (number of row index in Steps without counting groups, starting from 0)
- status (name of status configured in Steps status in project)
See the sample file with a structure - change_steps_status.json
Change Steps statuses
This endpoint allows you to change the statuses of steps. Body request should be passed as JSON.
Method: PUT
URL: $jira_context/rest/tms/1.0/api/steps/statuses
Body request properties:
- issueId (ID issue number in which the status in the Steps has to be changed)
- rows - list of rows to update, each object must contain: * rowIndex (number of row index in Steps without counting groups, starting from 0) * status (name of status configured in Steps status in project)
See the sample file with a structure - change_steps_statuses.json
Create TC with Steps
This endpoint allows you to create Test Case with Steps. Body request should be passed as JSON.
Method: POST
URL: $jira_context/rest/api/2/issue
Body request properties:
- key (project)
- parent (key of parent issue)
- issuetype (Test Case)
- customfield_ID (ID number of TC Template field, issuekey of TCT)
- customfield_ID (ID number of Steps field)
- isGroup (value: true or false)
- If the property is true, it is a group.
- If the property is false, then this is a step.
- cells
- If the isGroup property is set to true then fill in the name of the group. This property accepts only one cell.
- If the isGroup property is set to false then fill the data for the row from the Steps field. The number of columns in the file has to be the same as Steps columns configuration from the project.
See the sample file with a structure (configuration of three columns in Steps) - tc_create_with_steps.json
Create TCT with Steps
This endpoint allows you to create Test Case Templates with Steps. Body request should be passed as JSON.
Method: POST
URL: $jira_context/rest/api/2/issue
Body request properties:
- key (project)
- issuetype (Test Case Template)
- customfield_ID (ID number of Steps field)
- isGroup (value: true or false)
- If the property is true, it is a group.
- If the property is false, then this is a step.
- cells
- If the isGroup property is set to true then fill in the name of the group. This property accepts only one cell.
- If the isGroup property is set to false then fill the data for the row from the Steps field. The number of columns in the file has to be the same as Steps columns configuration from the project.
See the sample file with a structure (configuration of three columns in Steps) - tct_create_with_steps.json
Create TCT with Preconditions
This endpoint allows you to create Test Case Templates with Preconditions. Body request should be passed as JSON.
Method: POST
URL: $jira_context/rest/api/2/issue
Body request properties:
- key (project)
- issuetype (ID of Test Case Template issue type)
- customfield_ID (ID number of Preconditions field)
See the sample file with a structure - tct_create_with_preconditions.json
Update Steps at issue
This endpoint allows you to update Steps at issue. Body request should be passed as JSON.
Method: PUT
URL: $jira_context/rest/api/2/issue/{ISSUE-KEY}
Body request properties:
- customfield_ID (ID number of Steps field)
- isGroup (value: true or false)
- If the property is true, it is a group.
- If the property is false, then this is a step.
- cells
- If the isGroup property is set to true then fill in the name of the group. This property accepts only one cell.
- If the isGroup property is set to false then fill the data for the row from the Steps field. The number of columns in the file has to be the same as Steps columns configuration from the project.
See the sample file with a structure (configuration of three columns in Steps) - update_steps_at_issue.json
Update Preconditions at issue
This endpoint allows you to update Preconditions at issue. Body request should be passed as JSON.
Method: PUT
URL: $jira_context/rest/api/2/issue/{ISSUE-KEY}
Body request properties:
- customfield_ID (ID number of Preconditions field)
See the sample file with a structure - update_preconditions_at_issue.json
Copy Test Plan
This endpoint allows you to use the Copy Test Plan operation. Body request should be passed as JSON.
Method: POST
URL: $jira_context/rest/tms/1.0/api/testplan/copy
Body request properties:
- testPlanKey - issue key of the source test plan.
- projects (optional) - list of projects, in which test plan copies will be created, if skipped default project comes from copied test plan.
- copyStrategy (optional) - method of creating test cases on test plan copies. Valid values: * BY_TEST_CASE_TEMPLATES (default) - test cases will be created with data from their templates. * BY_TEST_CASES - test cases will be created with data from test cases from source test plan.
- issueIds (optional) - list of test cases/test case templates ids to copy, if not provided then all issues are copied.
- async (optional) - should request be executed asynchronously, default is false. If true then result will not contain created test cases.
See the sample file with a structure - copy_tp.json
Get Test Case ids on Test Plan
This endpoint allows you to get Test Case ids on Test Plan. Returned ids are ordered same as on Test Plan.
Method: GET
URL: $jira_context/rest/tms/1.0/api/testplan/test-case-ids/{TEST-PLAN-KEY}
Get Test Case Template ids on Test Plan
This endpoint allows you to get Test Case Template ids on Test Plan. Returned ids are unique and ordered the same as Test Cases on Test Plan. Body request should be passed as JSON.
Method: GET
URL: $jira_context/rest/tms/1.0/api/testplan/test-case-template-ids/{TEST-PLAN-KEY}?onlyActive=false
Body request properties:
- onlyActive (value: true/false):
- if property is true, then returns only active templates.
- if property is false, then returns all templates (active and inactive). This property is set as the default.
Modify Enhanced Issues Picker custom field
This endpoint allows you to modify Enhanced Issues Picker custom field (Requirement custom field). Body request should be passed as JSON.
Below you will find an example creating Test Case Template with Requirement value.
Method: POST
URL: $jira_context/rest/api/2/issue
Body request properties:
- customfield_ID (ID number of Requirement field)
See the sample file with a structure - modify-eip.json
Add Test Case Templates to existing Test Plans
This endpoint allows you to add Test Case Templates to existing Test Plans (creating Test Cases). Body request should be passed as JSON.
Method: POST
URL: $jira_context/rest/tms/1.0/api/testplan/add-test-case-templates
Body request properties:
- testPlanKeys list of Test Plan keys to which Test Case Template will be added
- testCaseTemplateKeys list of Test Case Templates that will be added to Test Plan
- async (value: true/false):
- if the property is true then the response won’t contain created Test Case issue keys and there will be no error message when the user doesn’t have Create Issues permission (the Test Cases won’t be created). The process of creating Test Cases will be executed asynchronously.
- if the property is false then the response will contain created Test Case issue keys and if the user doesn’t have Create Issues permission there will appear an error message.
See the sample file with a structure - add-test-case-templates.json
Add comment to Steps
This endpoint allows you to add a comment to a given row in the Steps field. Body request should be passed as JSON.
Method: PUT
URL: $jira_context/rest/tms/1.0/api/steps/comment
Body request properties:
- issueId the ID of the issue where you want to put a comment to given Step.
- rowIndex number of row index in Steps without counting groups, starting from 0.
- comment content of comment.
Example of body request:
{
"issueId": "10068",
"rowIndex": 3,
"comment": "Put here your comment"
}
Edit a single cell in Steps
This endpoint allows you to edit single cell in the Steps field. Body request should be passed as JSON.
Method: PUT
URL: $jira_context/rest/tms/1.0/api/steps/cell
Body request properties:
- issueId the ID of the issue where you want to put a comment to given Step.
- rowIndex number of row index in Steps without counting groups, starting from 0.
- columnIndex number of column index in Steps, starting from 0.
- cellValue content of the cell.
Example of body request:
{
"issueId": "10068",
"rowIndex": 1,
"columnIndex": 1,
"cellValue": "Here you can write the content of the given cell in Steps field"
}
Add attachments to Steps
This endpoint allows you to add attachments to given row in Steps field.
This resource expects a media-type multipart/form-data. The name of the multipart/form-data parameter that contains attachments must be “file”.
Method: POST
URL: $jira_context/rest/tms/1.0/api/steps/attachment?issueId={issueId}&rowIndex={rowIndex}
Parameters:
- issueId the ID of the issue where you want to import a attachment/s to given Step.
- rowIndex number of row index in Steps without counting groups, starting from 0.
Example of raw http request:
POST /rest/tms/1.0/api/steps/attachment?issueId=10068&rowIndex=2 HTTP/1.1
Host: localhost:8520
Authorization: Basic YWRtaW46YWRtaW4=
Cache-Control: no-cache
Postman-Token: 7f565782-eca1-dc36-c284-10db6814db1b
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="file"; filename="sample-file.xlsx"
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
------WebKitFormBoundary7MA4YWxkTrZu0gW--