TestFLO - Test Management for Jira

Last updated Jun 10, 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

Below you can find REST endpoint for the Change Steps status. 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)

See the sample file with a structure - change_steps_status.json

Create TC with Steps

Below you can find REST endpoint for the 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.

See the sample file with a structure (configuration of three columns in Steps) - tc_create_with_steps.json

Create TCT with Steps

Below you can find REST endpoint for the 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.

See the sample file with a structure (configuration of three columns in Steps) - tct_create_with_steps.json

Create TCT with Preconditions

Below you can find REST endpoint for the 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)

See the sample file with a structure - tct_create_with_preconditions.json

Update Steps at issue

Below you can find REST endpoint for the 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.

See the sample file with a structure (configuration of three columns in Steps) - update_steps_at_issue.json

Update Preconditions at issue

Below you can find REST endpoint for the 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)

See the sample file with a structure - update_preconditions_at_issue.json

Copy Test Plan

Below you can find REST endpoint for 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.
  • 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.

See the sample file with a structure - copy_tp.json