Iteration Test Plan Items

This chapter focuses on services for iteration test plan items. An iteration test plan item represents a test case that has been planned in an iteration test plan. It belongs to an iteration, and binds together the test case to execute with a dataset (optional) and an assigned user (optional).

Get iteration test plan item

A GET to /iteration-test-plan-items/{id} returns the iteration test plan item with the given id.

Path parameters

Table 1. /api/rest/latest/iteration-test-plan-items/{id}
Parameter Description

id

the id of the iteration test plan item

HTTP request

GET /api/rest/latest/iteration-test-plan-items/4 HTTP/1.1
Accept: application/json
Host: localhost:8080

Request parameters

Parameter Description

fields

which fields of the elements should be returned (optional)

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1835

{
  "_type" : "iteration-test-plan-item",
  "id" : 6,
  "execution_status" : "SUCCESS",
  "referenced_test_case" : {
    "_type" : "test-case",
    "id" : 3,
    "name" : "Test Case 3",
    "reference" : "TC3",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/3"
      }
    }
  },
  "referenced_dataset" : {
    "_type" : "dataset",
    "id" : 2,
    "name" : "Dataset 2",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/datasets/2"
      }
    }
  },
  "last_executed_by" : "User 6",
  "last_executed_on" : "2017-02-04T11:00:00.000+00:00",
  "assigned_to" : "User 6",
  "executions" : [ {
    "_type" : "execution",
    "id" : 10,
    "execution_status" : "SUCCESS",
    "last_executed_by" : "User 6",
    "last_executed_on" : "2017-02-04T11:00:00.000+00:00",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/executions/10"
      }
    }
  } ],
  "iteration" : {
    "_type" : "iteration",
    "id" : 1,
    "name" : "Iteration 1",
    "reference" : "IT1",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/iterations/1"
      }
    }
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/6"
    },
    "project" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/1"
    },
    "test-case" : {
      "href" : "http://localhost:8080/api/rest/latest/test-cases/3"
    },
    "dataset" : {
      "href" : "http://localhost:8080/api/rest/latest/datasets/2"
    },
    "iteration" : {
      "href" : "http://localhost:8080/api/rest/latest/iterations/1"
    },
    "executions" : {
      "href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/6/executions"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of this entity

id

Number

the id of this iteration test plan item

execution_status

String

the execution status of this item

referenced_test_case

Object

the corresponding test case of this item

referenced_dataset

Object

the referenced dataset of this item

last_executed_by

String

the login of the user who last executed this item

last_executed_on

String

the date this item was last executed

assigned_to

String

the login of the user this item is assigned to

executions

Array

all the executions of this item

iteration

Object

the iteration this item belongs to

_links

Object

related links

Relation Description

self

link to this iteration test plan item

project

link to the project this item belongs to

test-case

link to the test case corresponding to this item

dataset

link to the dataset used in this item

iteration

link to the iteration this item belongs to

executions

link to the executions of this item

Create iteration test plan item

A POST to /iterations/{iterationId}/test-plan creates a new entry in the test plan of the iteration with the given id. The entry must reference a test case, and optionally for which dataset and which assignee. If specified, the dataset must belong to the referenced Test Case. The dataset and/or assignee may be undefined or null if you don’t want to set them yet.

Path parameters

Table 1. /api/rest/latest/iterations/{iterationId}/test-plan
Parameter Description

iterationId

the id of the iteration

HTTP request

POST /api/rest/latest/iterations/4/test-plan HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 193
Host: localhost:8080

{
  "_type" : "iteration-test-plan-item",
  "test_case" : {
    "_type" : "test-case",
    "id" : 25
  },
  "dataset" : {
    "_type" : "dataset",
    "id" : 3
  },
  "assigned_to" : "User-1"
}

Request fields

Path Type Description

_type

String

the type of the entity

test_case

Object

the test case to include in the test plan (as described below)

test_case._type

String

the type of the entity (always 'test-case')

test_case.id

Number

the id of the test case

dataset

Object

the dataset to be used when the test case will be executed (optional)

dataset._type

String

the type of the entity (always 'dataset')

dataset.id

Number

the id of the dataset. Remember that the dataset must belong to the planned test case.

assigned_to

String

the username of the user assigned to this test case (optional)

HTTP response

HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 1381

{
  "_type" : "iteration-test-plan-item",
  "id" : 38,
  "execution_status" : "READY",
  "referenced_test_case" : {
    "_type" : "test-case",
    "id" : 25,
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/25"
      }
    }
  },
  "referenced_dataset" : {
    "_type" : "dataset",
    "id" : 3,
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/datasets/3"
      }
    }
  },
  "last_executed_by" : null,
  "last_executed_on" : null,
  "assigned_to" : "User-1",
  "executions" : [ ],
  "iteration" : {
    "_type" : "iteration",
    "id" : 4,
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/iterations/4"
      }
    }
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/38"
    },
    "project" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/14"
    },
    "test-case" : {
      "href" : "http://localhost:8080/api/rest/latest/test-cases/25"
    },
    "dataset" : {
      "href" : "http://localhost:8080/api/rest/latest/datasets/3"
    },
    "iteration" : {
      "href" : "http://localhost:8080/api/rest/latest/iterations/4"
    },
    "executions" : {
      "href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/38/executions"
    }
  }
}

Modify iteration test plan item

A Patch to /iteration-test-plan-items/{id} modifies the iteration test plan item with the given id. You can modify the planned dataset, the assignee, or both. A property left absent from the json payload will not be altered, if present with a null value they will be reset. You cannot change the planned test case.

Path parameters

Table 1. /api/rest/latest/iteration-test-plan-items/{id}
Parameter Description

id

the id of the iteration test plan item

HTTP request

PATCH /api/rest/latest/iteration-test-plan-items/50 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 129
Host: localhost:8080

{
  "_type" : "iteration-test-plan-item",
  "dataset" : {
    "_type" : "dataset",
    "id" : 3
  },
  "assigned_to" : "User-1"
}

Request fields

Path Type Description

_type

String

the type of the entity

dataset

Object

the dataset to use when the test case is executed (optional). You can remove the dataset by setting this to null.

dataset._type

String

the type of the entity ('dataset')

dataset.id

Number

the id of this dataset

assigned_to

String

the username of the user assigned to this test (optional). You can assign this test to nobody by setting this to null.

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1497

{
  "_type" : "iteration-test-plan-item",
  "id" : 50,
  "execution_status" : "READY",
  "referenced_test_case" : {
    "_type" : "test-case",
    "id" : 25,
    "name" : "AKM-Test case 1",
    "reference" : "",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/test-cases/25"
      }
    }
  },
  "referenced_dataset" : {
    "_type" : "dataset",
    "id" : 3,
    "name" : "Jeu2",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/datasets/3"
      }
    }
  },
  "last_executed_by" : null,
  "last_executed_on" : null,
  "assigned_to" : "User-1",
  "executions" : [ ],
  "iteration" : {
    "_type" : "iteration",
    "id" : 4,
    "name" : null,
    "reference" : "",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/iterations/4"
      }
    }
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/50"
    },
    "project" : {
      "href" : "http://localhost:8080/api/rest/latest/projects/14"
    },
    "test-case" : {
      "href" : "http://localhost:8080/api/rest/latest/test-cases/25"
    },
    "dataset" : {
      "href" : "http://localhost:8080/api/rest/latest/datasets/3"
    },
    "iteration" : {
      "href" : "http://localhost:8080/api/rest/latest/iterations/4"
    },
    "executions" : {
      "href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/50/executions"
    }
  }
}

Delete iteration test plan item

A DELETE to /iteration-test-plan-items/{testPlanItemsIds} deletes one or several iteration test plan items with the given id(s).

Path parameters

Table 1. /api/rest/latest/iteration-test-plan-items/{testPlanItemsIds}
Parameter Description

testPlanItemsIds

the list of ids of the iteration test plan items

HTTP request

DELETE /api/rest/latest/iteration-test-plan-items/45,46 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080

Get executions of iteration test plan item

A GET to /iteration-test-plan-items/{id}/executions returns all the executions of the iteration test plan item with the given id.

Path parameters

Table 1. /api/rest/latest/iteration-test-plan-items/{id}/executions
Parameter Description

id

the id of the iteration-test-plan-item

HTTP request

GET /api/rest/latest/iteration-test-plan-items/1/executions?size=3&page=1 HTTP/1.1
Accept: application/json
Host: localhost:8080

Request parameters

Parameter Description

page

number of the page to retrieve (optional)

size

size of the page to retrieve (optional)

sort

which attributes of the returned entities should be sorted on (optional)

fields

which fields of the elements should be returned (optional)

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1837

{
  "_embedded" : {
    "executions" : [ {
      "_type" : "execution",
      "id" : 10,
      "name" : "TC1 - Test Case 1",
      "execution_order" : 0,
      "execution_status" : "FAILURE",
      "last_executed_by" : "User 8",
      "last_executed_on" : "2017-06-12T10:00:00.000+00:00",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/executions/10"
        }
      }
    }, {
      "_type" : "execution",
      "id" : 11,
      "name" : "TC1 - Test Case 1",
      "execution_order" : 1,
      "execution_status" : "BLOCKED",
      "last_executed_by" : "User 8",
      "last_executed_on" : "2017-06-13T10:00:00.000+00:00",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/executions/11"
        }
      }
    }, {
      "_type" : "execution",
      "id" : 12,
      "name" : "TC1 - Test Case 1",
      "execution_order" : 2,
      "execution_status" : "SUCCESS",
      "last_executed_by" : "User 8",
      "last_executed_on" : "2017-06-14T10:00:00.000+00:00",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/api/rest/latest/executions/12"
        }
      }
    } ]
  },
  "_links" : {
    "first" : {
      "href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/1/executions?page=0&size=3"
    },
    "prev" : {
      "href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/1/executions?page=0&size=3"
    },
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/1/executions?page=1&size=3"
    },
    "last" : {
      "href" : "http://localhost:8080/api/rest/latest/iteration-test-plan-items/1/executions?page=1&size=3"
    }
  },
  "page" : {
    "size" : 3,
    "totalElements" : 6,
    "totalPages" : 2,
    "number" : 1
  }
}

Response fields

Path Type Description

_embedded.executions

Array

the list of elements for that page

page.size

Number

the page size for that query

page.totalElements

Number

total number of elements the user is allowed to read

page.totalPages

Number

how many pages can be browsed

page.number

Number

the page number

_links

Object

related links

Relation Description

first

link to the first page (optional)

prev

link to the previous page (optional)

self

link to this page

next

link to the next page (optional)

last

link to the last page (optional)