Apps documentation
TestFLO - Test Management for Jira
TestFLO - Test Management for Jira
7.9.x
7.8.x
7.7.x
7.5.x
7.4.x
7.3.x
7.2.x
7.1.x
7.0.x
FAQ
Release notes
Last updated Nov 26, 2019

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
  • Others

We have extended REST API with following methods:

Change Steps status

This endpoint allows you to change the status of the steps. Parameters should be passed in a JSON file.

Method: PUT

URL: $jira_context/rest/tms/1.0/steps/status

Parameters:

  • 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)
Example

See the sample file with a structure - change_steps_status.json

Create TC with Steps

This endpoint allows you to create Test Case with Steps. Parameters should be passed in a JSON file.

Method: POST

URL: $jira_context/rest/api/2/issue

Parameters:

  • 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 parameter is true, it is a group.
    • If the parameter is false, then this is a step.
  • cells

    • If the isGroup parameter is set to true then fill in the name of the group. This parameter accepts only one cell.
    • If the isGroup parameter 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.
Example

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. Parameters should be passed in a JSON file.

Method: POST

URL: $jira_context/rest/api/2/issue

Parameters:

  • key (project)

  • issuetype (Test Case Template)

  • customfield_ID (ID number of Steps field)

  • isGroup (value: true or false)

    • If the parameter is true, it is a group.
    • If the parameter is false, then this is a step.
  • cells

    • If the isGroup parameter is set to true then fill in the name of the group. This parameter accepts only one cell.
    • If the isGroup parameter 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.
Example

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. Parameters should be passed in a JSON file.

Method: POST

URL: $jira_context/rest/api/2/issue

Parameters:

  • key (project)
  • issuetype (ID of Test Case Template issue type)
  • customfield_ID (ID number of Preconditions field)
Example

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. Parameters should be passed in a JSON file.

Method: PUT

URL: $jira_context/rest/api/2/issue/{ISSUE-KEY}

Parameters:

  • customfield_ID (ID number of Steps field)

  • isGroup (value: true or false)

    • If the parameter is true, it is a group.
    • If the parameter is false, then this is a step.
  • cells

    • If the isGroup parameter is set to true then fill in the name of the group. This parameter accepts only one cell.
    • If the isGroup parameter 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.
Example

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. Parameters should be passed in a JSON file.

Method: PUT

URL: $jira_context/rest/api/2/issue/{ISSUE-KEY}

Parameters:

  • customfield_ID (ID number of Preconditions field)
Example

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. Parameters should be passed in a JSON file.

Method: POST

URL: $jira_context/rest/tms/1.0/testplan/copy

Parameters:

  • 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.

Example

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/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. Parameters should be passed in a JSON file.

Method: GET

URL: $jira_context/rest/tms/1.0/testplan/test-case-template-ids/{TEST-PLAN-KEY}?onlyActive=false

Parameters:

  • onlyActive (value: true/false):
    • if parameter is true, then returns only active templates.
    • if parameter is false, then returns all templates (active and inactive). This parameter 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). Parameters should be passed in a JSON file.

Below you will find an example creating Test Case Template with Requirement value.

Method: POST

URL: $jira_context/rest/api/2/issue

Parameters:

  • customfield_ID (ID number of Requirement field)
Example

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). Parameters should be passed in a JSON file.

Method: POST

URL: $jira_context/rest/tms/1.0/testplan/add-test-case-templates

Parameters

  • 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 parameter 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 parameter 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.
Example

See the sample file with a structure - add-test-case-templates.json